@thekestongroup/ui 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thekestongroup/ui",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "Keston UI — Vue 3 + Reka UI + Tailwind CSS component library",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -25,6 +25,12 @@ export const Default: Story = {
25
25
  decorators: [() => ({ template: '<div class="max-w-72"><story /></div>' })],
26
26
  };
27
27
 
28
+ /** After submitting without meeting everything: the circles not done yet turn red. */
29
+ export const Invalid: Story = {
30
+ decorators: [() => ({ template: '<div class="max-w-72"><story /></div>' })],
31
+ args: { invalid: true },
32
+ };
33
+
28
34
  /** Long steps wrap; the icon stays level with the first line. */
29
35
  export const LongItems: Story = {
30
36
  decorators: [() => ({ template: '<div class="max-w-72"><story /></div>' })],
@@ -16,6 +16,8 @@ export interface ChecklistItem {
16
16
 
17
17
  export interface ChecklistProps {
18
18
  items: ChecklistItem[]
19
+ /** Turns the circles of items not done yet red, e.g. after submitting a form that doesn't meet them. */
20
+ invalid?: boolean
19
21
  class?: HTMLAttributes['class']
20
22
  }
21
23
 
@@ -28,7 +30,7 @@ const props = defineProps<ChecklistProps>()
28
30
  <!-- h-5 keeps the icon level with the first line of a label that wraps. -->
29
31
  <span class="flex h-5 shrink-0 items-center">
30
32
  <CircleCheck v-if="item.done" class="size-4 text-green" aria-hidden="true" />
31
- <Circle v-else class="size-4 text-black/40" aria-hidden="true" />
33
+ <Circle v-else :class="cn('size-4', invalid ? 'text-red' : 'text-black/40')" aria-hidden="true" />
32
34
  </span>
33
35
  <span :class="item.done ? 'text-black' : 'text-black/65'">
34
36
  {{ item.label }}<span class="sr-only">{{ item.done ? ' (done)' : ' (to do)' }}</span>
@@ -202,6 +202,7 @@ function runAction(action: HeaderUserAction, close: () => void) {
202
202
  <p
203
203
  v-if="user.organisation"
204
204
  class="truncate px-4 pt-3 text-xs font-bold text-black/65 uppercase"
205
+ :title="user.organisation"
205
206
  >
206
207
  {{ user.organisation }}
207
208
  </p>
@@ -211,8 +212,8 @@ function runAction(action: HeaderUserAction, close: () => void) {
211
212
  <div class="grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-3 gap-y-2 px-4 py-3">
212
213
  <Avatar :user="user" size="lg" decorative />
213
214
  <div class="flex min-w-0 flex-col">
214
- <span class="truncate font-bold">{{ user.name }}</span>
215
- <span v-if="user.email" class="truncate text-sm text-black/65">{{ user.email }}</span>
215
+ <span class="truncate font-bold" :title="user.name">{{ user.name }}</span>
216
+ <span v-if="user.email" class="truncate text-sm text-black/65" :title="user.email">{{ user.email }}</span>
216
217
  </div>
217
218
  <Button
218
219
  v-if="userActions.includes('account-settings')"
@@ -295,6 +295,10 @@ const panel = [
295
295
  v-if="title || description || close || steps || $slots.header || $slots.title"
296
296
  :class="cn('flex flex-col gap-4 border-b border-black/15 px-6 py-4', ui?.header)"
297
297
  >
298
+ <!-- The step sits above its progress bar. -->
299
+ <p v-if="steps" :id="stepLabelId" class="text-sm text-black/65">
300
+ Step {{ step + 1 }} of {{ stepCount }}: <span class="text-black">{{ steps[step] }}</span>
301
+ </p>
298
302
  <Progress v-if="steps" :label="title ?? t('ui.slideover.steps')" segments :value="step + 1" :max="stepCount" />
299
303
  <div class="flex items-start gap-4">
300
304
  <slot name="header" :close="closePanel">
@@ -310,9 +314,7 @@ const panel = [
310
314
  class="flex flex-col gap-1 text-sm text-black/65"
311
315
  >
312
316
  <p v-if="description || $slots.description"><slot name="description">{{ description }}</slot></p>
313
- <p v-if="steps" :id="stepLabelId">
314
- Step {{ step + 1 }} of {{ stepCount }}: <span class="text-black">{{ steps[step] }}</span>
315
- </p>
317
+ <p v-if="steps" class="sr-only">{{ stepText }}</p>
316
318
  </DialogDescription>
317
319
  <p v-if="steps" aria-live="polite" class="sr-only">{{ announcement }}</p>
318
320
  </div>
@@ -6,7 +6,7 @@ import Progress from '../Progress/Progress.vue'
6
6
 
7
7
  /**
8
8
  * Where someone is in a set of steps: a segment for each step, filled up to
9
- * the current one, and "Step 2 of 3: Licences" under it. Put it at the top of
9
+ * the current one, and "Step 2 of 3: Licences" above it. Put it at the top of
10
10
  * a multi-step form. (Slideover's `steps` shows one for you; use this when
11
11
  * the steps are on a page, or in a Slideover you drive yourself.) The words
12
12
  * are announced when the step changes.
@@ -26,7 +26,6 @@ const props = defineProps<StepsProps>()
26
26
 
27
27
  <template>
28
28
  <div :class="cn('flex flex-col gap-3', props.class)">
29
- <Progress :label="label" segments :value="step + 1" :max="steps.length" />
30
29
  <p class="text-sm text-black/65" aria-live="polite">
31
30
  <I18nT keypath="ui.steps.stepOfNamed" scope="global" tag="span">
32
31
  <template #current>{{ step + 1 }}</template>
@@ -34,5 +33,6 @@ const props = defineProps<StepsProps>()
34
33
  <template #name><span class="text-black">{{ steps[step] }}</span></template>
35
34
  </I18nT>
36
35
  </p>
36
+ <Progress :label="label" segments :value="step + 1" :max="steps.length" />
37
37
  </div>
38
38
  </template>