Skip to content

Commit d7d2ed0

Browse files
Afriq Yasin RamadhanAfriq Yasin Ramadhan
authored andcommitted
fix: change color of progressbar and progress indicator, add warning variant of banner, change warning color in light mode
1 parent d555402 commit d7d2ed0

14 files changed

Lines changed: 64 additions & 20 deletions

File tree

packages/tailwind-preset/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = {
102102
'state-emphasis': theme.colors.gray[0],
103103
'info' : theme.colors.blue[60],
104104
'success' : theme.colors.green[60],
105-
'warning' : theme.colors.orange[70],
105+
'warning' : theme.colors.orange[60],
106106
'danger' : theme.colors.red[60],
107107
'dark' : {
108108
'DEFAULT' : theme.colors.gray[0],

src/components/banner/Banner.vue

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
<script lang="ts" setup>
3232
import IconInfo from '@privyid/persona-icon/vue/information-circle-solid/20.vue'
33-
import IconDanger from '@privyid/persona-icon/vue/exclamation-circle-solid/20.vue'
33+
import IconDanger from '@privyid/persona-icon/vue/exclamation-triangle-solid/20.vue'
34+
import IconWarning from '@privyid/persona-icon/vue/exclamation-circle-solid/20.vue'
3435
import IconClose from '@privyid/persona-icon/vue/close/16.vue'
3536
import type {
3637
PropType,
@@ -41,8 +42,9 @@ import { ref, computed } from 'vue-demi'
4142
import type { StyleVariant } from '.'
4243
4344
const BannerIcons = {
44-
danger: IconDanger,
45-
info : IconInfo,
45+
danger : IconDanger,
46+
info : IconInfo,
47+
warning: IconWarning,
4648
}
4749
4850
const props = defineProps({
@@ -184,6 +186,16 @@ defineSlots<{
184186
}
185187
}
186188
189+
&&--warning {
190+
@apply bg-warning;
191+
@apply dark:bg-dark-warning;
192+
193+
.banner__icon {
194+
@apply text-warning;
195+
@apply dark:text-dark-warning;
196+
}
197+
}
198+
187199
&__body {
188200
@apply grow text-sm;
189201
}

src/components/banner/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,19 @@ description: Alert to convey information or actions
133133

134134
## Variants
135135

136-
Banner have 2 variants: `info` and `danger`, default is `info`
136+
Banner have 3 variants: `info`, `warning` and `danger`, default is `info`
137137

138138
<preview class="flex-col space-y-3">
139139
<p-banner variant="info">
140140
Every sign will requires privy balance.
141141
Please make sure you have enough privy balance
142142
before sign the document(s)
143143
</p-banner>
144+
<p-banner variant="warning">
145+
Every sign will requires privy balance.
146+
Please make sure you have enough privy balance
147+
before sign the document(s)
148+
</p-banner>
144149
<p-banner variant="danger">
145150
Every sign will requires privy balance.
146151
Please make sure you have enough privy balance
@@ -155,6 +160,11 @@ Banner have 2 variants: `info` and `danger`, default is `info`
155160
Please make sure you have enough privy balance
156161
before sign the document(s)
157162
</p-banner>
163+
<p-banner variant="warning">
164+
Every sign will requires privy balance.
165+
Please make sure you have enough privy balance
166+
before sign the document(s)
167+
</p-banner>
158168
<p-banner variant="danger">
159169
Every sign will requires privy balance.
160170
Please make sure you have enough privy balance
@@ -246,7 +256,7 @@ Banner use local CSS variables on `.banner` for enhanced real-time customization
246256

247257
| Props | Type | Default | Description |
248258
|---------------------|:---------:|:-------:|-------------------------------------------------|
249-
| `variant` | `String` | `info` | Banner variant, valid value is `info`, `danger` |
259+
| `variant` | `String` | `info` | Banner variant, valid value is `info`, `warning` & `danger` |
250260
| `dismissable` | `Boolean` | `true` | Show / Hide dismiss button |
251261
| `backgroundUrl` | `String` | - | Custom background image of banner |
252262
| `backgroundDarkUrl` | `String` | - | Custom background image of banner in Dark Mode |

src/components/banner/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type StyleVariant = 'info' | 'danger'
1+
export type StyleVariant = 'info' | 'danger' | 'warning'

src/components/dropdown/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ description: Base dropdown button, suit for action menus
99
import pDropdown from "./Dropdown.vue"
1010
import pDropdownItem from "./DropdownItem.vue"
1111
import pDropdownHeader from './DropdownHeader.vue'
12+
import pAccordionItem from '../accordion/AccordionItem.vue'
1213
import Banner from '../banner/Banner.vue'
1314
import pCheckbox from '../checkbox/Checkbox.vue'
1415
import pRadio from '../radio/Radio.vue'
@@ -19,6 +20,7 @@ description: Base dropdown button, suit for action menus
1920

2021
const show = ref(false)
2122
const selected = ref('')
23+
const sample = ref(false)
2224
</script>
2325

2426
# Dropdown

src/components/input/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description: Base text-input form.
1010
import IconCheck from '@privyid/persona-icon/vue/information-circle-solid/20.vue'
1111
import IconEmail from '@privyid/persona-icon/vue/email/20.vue'
1212
import PSpinner from '../spinner/Spinner.vue'
13+
import PBanner from '../banner/Banner.vue'
1314

1415
const value = ref('')
1516
const result = ref('')
@@ -105,6 +106,10 @@ Add clear button to input with prop `clearable`.
105106
## Prepend & Append
106107
Input has append & prepend feature to place content inside input field. But the content that can be inserted is limited, which is only an icon.
107108

109+
<p-banner :dismissable="false">
110+
When the prepend of <code>Textfield</code> was an icon, the color of icon must be <code>fg.subtle</code> (<code>.text-subtle</code>) and or <code>fg.subtlest</code> (<code>.text-subtlest</code>).
111+
</p-banner>
112+
108113
### Prepend
109114
<preview class="flex-col space-y-3">
110115
<p-input>
@@ -136,6 +141,10 @@ Input has append & prepend feature to place content inside input field. But the
136141

137142
### Append
138143

144+
<p-banner :dismissable="false" class="mt-4">
145+
When the append of <code>Textfield</code> was an icon, the color of icon must be <a href="/design-system/foundation/colors/#brand">brand</a> and or <a href="/design-system/foundation/colors/#foregrounds">state(roles)</a> foregrounds. The spinner (circle loading) of <code>Textfield</code> must be <a href="/design-system/foundation/colors/#brand">brand</a>, <code>fg.subtle</code> (<code>.text-subtle</code>) and or <code>fg.subtlest</code> (<code>.text-subtlest</code>).
146+
</p-banner>
147+
139148
<preview class="flex-col space-y-3">
140149
<p-input>
141150
<template #append>

src/components/progress-indicator/ProgressIndicator.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,25 @@ function setValue (value: number) {
8484

8585
<style lang="postcss">
8686
.progress-indicator {
87+
--p-bg-indicator-item: theme(backgroundColor.subtle.alpha);
88+
--p-bg-dark-indicator-item: theme(backgroundColor.dark.subtle.alpha);
89+
--p-bg-indicator-item-active: theme(backgroundColor.brand.accent);
90+
--p-bg-dark-indicator-item-active: theme(backgroundColor.dark.brand.accent);
91+
8792
@apply relative;
8893
8994
&__container {
9095
@apply flex flex-1;
9196
}
9297
9398
&__item {
94-
@apply bg-gray-50/30 cursor-pointer;
99+
@apply bg-[color:var(--p-bg-indicator-item)] cursor-pointer;
100+
@apply dark:bg-[color:var(--p-bg-dark-indicator-item)];
95101
96102
&--active {
97103
@apply absolute top-0 left-0 transition-transform;
98-
@apply bg-gray-50 pointer-events-none;
104+
@apply bg-[color:var(--p-bg-indicator-item-active)] pointer-events-none;
105+
@apply dark:bg-[color:var(--p-bg-dark-indicator-item-active)];
99106
}
100107
}
101108

src/components/progress/Progress.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ const item = computed<ProgressLabel>(() => {
111111
}
112112
113113
&__point {
114-
@apply w-7 h-7 rounded-full bg-subtle flex items-center justify-center text-default;
115-
@apply dark:bg-dark-subtle dark:text-dark-default;
114+
@apply w-7 h-7 rounded-full bg-[color:var(--p-bg-bar-normal-state)] flex items-center justify-center text-default;
115+
@apply dark:bg-[color:var(--p-bg-dark-bar-normal-state)] dark:text-dark-default;
116116
}
117117
118118
&__bar {

src/components/progressbar/Progressbar.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ const classNames = computed(() => {
6969

7070
<style lang="postcss">
7171
.progressbar {
72-
@apply bg-base w-full h-1 rounded-full overflow-hidden;
73-
@apply dark:bg-dark-base;
72+
/* --p-bg-progress-default: theme(backgroundColor.base.DEFAULT); */
73+
--p-bg-progress-default: theme(backgroundColor.subtle.alpha);
74+
--p-bg-dark-progress-default: theme(backgroundColor.dark.subtle.alpha);
75+
76+
@apply bg-[color:var(--p-bg-progress-default)] w-full h-1 rounded-full overflow-hidden;
77+
@apply dark:[color:var(--p-bg-dark-progress-default)];
7478
7579
&__bar {
7680
@apply transition-[width] will-change-[width] duration-75 ease-out;

src/components/spinner/SpinnerRing.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ it('should render properly without any props', () => {
1010
const spinner = screen.getByTestId('spinner')
1111

1212
expect(spinner).toBeInTheDocument()
13-
expect(spinner).toHaveClass('spinner', 'spinner-ring')
13+
expect(spinner).toHaveClass('spinner', 'spinner--ring')
1414
})

0 commit comments

Comments
 (0)