@luscii-healthtech/web-ui 44.1.0 → 44.2.0

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.
@@ -1,5 +1,19 @@
1
1
  import React from "react";
2
- type Props = React.ComponentPropsWithRef<"input"> & {
2
+ /**
3
+ * @example
4
+ * ```tsx
5
+ * <LabeledCheckbox
6
+ * name="newsletter"
7
+ * id="newsletter"
8
+ * value="yes"
9
+ * label="Subscribe to newsletter"
10
+ * helperText="We will send you updates about new features."
11
+ * />
12
+ * ```
13
+ */
14
+ export declare const LabeledCheckbox: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
15
+ ref?: ((instance: HTMLInputElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLInputElement> | null | undefined;
16
+ } & {
3
17
  /**
4
18
  * The visual label next to the checkbox indicator.
5
19
  */
@@ -18,6 +32,7 @@ type Props = React.ComponentPropsWithRef<"input"> & {
18
32
  * a string as a prop. Will be rendered inside a `<Text>` component.
19
33
  */
20
34
  label?: React.ReactNode;
35
+ } & {
21
36
  /**
22
37
  * Any additional information to show underneath the label.
23
38
  */
@@ -27,18 +42,34 @@ type Props = React.ComponentPropsWithRef<"input"> & {
27
42
  * with the user's input.
28
43
  */
29
44
  errorText?: React.ReactNode;
30
- };
31
- /**
32
- * @example
33
- * ```tsx
34
- * <LabeledCheckbox
35
- * name="newsletter"
36
- * id="newsletter"
37
- * value="yes"
38
- * label="Subscribe to newsletter"
39
- * helperText="We will send you updates about new features."
40
- * />
41
- * ```
42
- */
43
- export declare const LabeledCheckbox: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
44
- export {};
45
+ aside?: never;
46
+ }, "ref"> & React.RefAttributes<HTMLInputElement>>;
47
+ export declare const LabeledCheckboxCard: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
48
+ ref?: ((instance: HTMLInputElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLInputElement> | null | undefined;
49
+ } & {
50
+ /**
51
+ * The visual label next to the checkbox indicator.
52
+ */
53
+ children?: React.ReactNode;
54
+ /**
55
+ * Additional classes to apply to the checkbox input HTML element.
56
+ */
57
+ inputClassName?: string;
58
+ /**
59
+ * Making `id` required, since it's important for accessibility.
60
+ */
61
+ id: string;
62
+ /**
63
+ * The visual label next to the checkbox indicator.
64
+ * Alternative to `children` for when it's easier to just pass
65
+ * a string as a prop. Will be rendered inside a `<Text>` component.
66
+ */
67
+ label?: React.ReactNode;
68
+ } & {
69
+ /**
70
+ * Slot rendered to the side of the label and helper text.
71
+ */
72
+ aside?: React.ReactNode;
73
+ helperText?: never;
74
+ errorText?: never;
75
+ }, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ type Props = React.ComponentPropsWithoutRef<"fieldset"> & {
3
+ children: React.ReactNode;
4
+ title?: string;
5
+ className?: string;
6
+ /**
7
+ * Over how many columns the checkbox cards should be distributed.
8
+ */
9
+ columns?: 1 | 2 | 3 | 4;
10
+ /**
11
+ * Any additional information to show underneath the radio group.
12
+ */
13
+ helperText?: React.ReactNode;
14
+ /**
15
+ * An error message that should be shown when there's something wrong
16
+ * with the user's input.
17
+ */
18
+ errorText?: React.ReactNode;
19
+ };
20
+ /**
21
+ * This component is used to group radio buttons together with a title, and provide
22
+ * a semantic helper and error text to the group. It requires children to function,
23
+ * in practice these are always `LabeledCheckboxCard` components.
24
+ */
25
+ export declare const LabeledCheckboxCardGroup: React.FC<Props>;
26
+ export {};
@@ -32,6 +32,8 @@ export { default as CenteredHero } from "./components/CenteredHero/CenteredHero"
32
32
  export { Checkbox } from "./components/Checkbox/Checkbox";
33
33
  export { LabeledCheckbox } from "./components/Checkbox/LabeledCheckbox";
34
34
  export { LabeledCheckboxGroup } from "./components/Checkbox/LabeledCheckboxGroup";
35
+ export { LabeledCheckboxCard } from "./components/Checkbox/LabeledCheckbox";
36
+ export { LabeledCheckboxCardGroup } from "./components/Checkbox/LabeledCheckboxCardGroup";
35
37
  export { Chip } from "./components/Chip/Chip";
36
38
  export { ConfirmationDialog } from "./components/ConfirmationDialog/ConfirmationDialog";
37
39
  export type { ConfirmationDialogChoice, ConfirmationDialogProps, ConfirmationDialogTitleProps, } from "./components/ConfirmationDialog/types/ConfirmationDialog.types";
@@ -9,8 +9,10 @@ declare const meta: {
9
9
  inputClassName?: string;
10
10
  id: string;
11
11
  label?: React.ReactNode;
12
+ } & {
12
13
  helperText?: React.ReactNode;
13
14
  errorText?: React.ReactNode;
15
+ aside?: never;
14
16
  }, "ref"> & React.RefAttributes<HTMLInputElement>>;
15
17
  parameters: {
16
18
  backgrounds: {
@@ -27,6 +29,8 @@ export default meta;
27
29
  type Story = StoryObj<typeof meta>;
28
30
  export declare const Base: Story;
29
31
  export declare const Overview: Story;
32
+ export declare const OverviewLabeledCheckboxCard: Story;
33
+ export declare const LabeledCheckboxCardGroupLarge: Story;
30
34
  export declare const Disabled: Story;
31
35
  export declare const MultipleCheckboxes: Story;
32
36
  export declare const WithHelperAndErrorText: Story;
@@ -115,6 +115,7 @@
115
115
  --ui-primitive-color-grey-700: #7387a4;
116
116
  --ui-primitive-color-grey-800: #3a4657;
117
117
  --ui-primitive-color-grey-900: #162130;
118
+ --ui-primitive-color-brand-100: #eff6ff;
118
119
  --ui-primitive-color-brand-500: #1d4ed8;
119
120
  --ui-primitive-color-brand-700: #1e40af;
120
121
  --ui-primitive-color-brand-900: #112d9c;
@@ -1004,6 +1005,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1004
1005
  .ui\:h-\[20px\] {
1005
1006
  height: 20px;
1006
1007
  }
1008
+ .ui\:h-\[22px\] {
1009
+ height: 22px;
1010
+ }
1007
1011
  .ui\:h-\[24px\] {
1008
1012
  height: 24px;
1009
1013
  }
@@ -1316,6 +1320,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1316
1320
  .ui\:max-w-\[500px\] {
1317
1321
  max-width: 500px;
1318
1322
  }
1323
+ .ui\:max-w-\[900px\] {
1324
+ max-width: 900px;
1325
+ }
1319
1326
  .ui\:max-w-\[calc\(100dvw-\(var\(--ui-spacing-xl\)\)\)\] {
1320
1327
  max-width: calc(100dvw - (var(--ui-spacing-xl)));
1321
1328
  }
@@ -1349,6 +1356,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1349
1356
  .ui\:flex-initial {
1350
1357
  flex: 0 auto;
1351
1358
  }
1359
+ .ui\:flex-shrink-0 {
1360
+ flex-shrink: 0;
1361
+ }
1352
1362
  .ui\:shrink-0 {
1353
1363
  flex-shrink: 0;
1354
1364
  }
@@ -1531,6 +1541,18 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1531
1541
  .ui\:appearance-none {
1532
1542
  appearance: none;
1533
1543
  }
1544
+ .ui\:grid-cols-1 {
1545
+ grid-template-columns: repeat(1, minmax(0, 1fr));
1546
+ }
1547
+ .ui\:grid-cols-2 {
1548
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1549
+ }
1550
+ .ui\:grid-cols-3 {
1551
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1552
+ }
1553
+ .ui\:grid-cols-4 {
1554
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1555
+ }
1534
1556
  .ui\:grid-cols-\[100px_auto\] {
1535
1557
  grid-template-columns: 100px auto;
1536
1558
  }
@@ -1677,6 +1699,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1677
1699
  .ui\:gap-x-2 {
1678
1700
  column-gap: calc(var(--ui-spacing) * 2);
1679
1701
  }
1702
+ .ui\:gap-x-m {
1703
+ column-gap: var(--ui-spacing-m);
1704
+ }
1680
1705
  .ui\:gap-x-s {
1681
1706
  column-gap: var(--ui-spacing-s);
1682
1707
  }
@@ -1718,6 +1743,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
1718
1743
  margin-inline-end: calc(calc(var(--ui-spacing) * 8) * calc(1 - var(--tw-space-x-reverse)));
1719
1744
  }
1720
1745
  }
1746
+ .ui\:gap-y-xs {
1747
+ row-gap: var(--ui-spacing-xs);
1748
+ }
1721
1749
  .ui\:divide-x {
1722
1750
  :where(& > :not(:last-child)) {
1723
1751
  --tw-divide-x-reverse: 0;
@@ -3026,6 +3054,10 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3026
3054
  --tw-shadow: none;
3027
3055
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
3028
3056
  }
3057
+ .ui\:ring {
3058
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
3059
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
3060
+ }
3029
3061
  .ui\:ring-1 {
3030
3062
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
3031
3063
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -3033,6 +3065,12 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3033
3065
  .ui\:ring-black {
3034
3066
  --tw-ring-color: var(--ui-color-black);
3035
3067
  }
3068
+ .ui\:ring-border-brand-primary-default {
3069
+ --tw-ring-color: var(--ui-primitive-color-brand-700);
3070
+ }
3071
+ .ui\:ring-border-neutral-primary-default {
3072
+ --tw-ring-color: var(--ui-primitive-color-grey-700);
3073
+ }
3036
3074
  .ui\:outline {
3037
3075
  outline-style: var(--tw-outline-style);
3038
3076
  outline-width: 1px;
@@ -4199,6 +4237,13 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4199
4237
  }
4200
4238
  }
4201
4239
  }
4240
+ .ui\:hover\:ring-border-neutral-primary-hovered {
4241
+ &:hover {
4242
+ @media (hover: hover) {
4243
+ --tw-ring-color: var(--ui-primitive-color-brand-500);
4244
+ }
4245
+ }
4246
+ }
4202
4247
  .ui\:hover\:transition-shadow {
4203
4248
  &:hover {
4204
4249
  @media (hover: hover) {
@@ -4417,6 +4462,51 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4417
4462
  }
4418
4463
  }
4419
4464
  }
4465
+ .ui\:has-checked\:ring-border-brand-primary-default {
4466
+ &:has(*:checked) {
4467
+ --tw-ring-color: var(--ui-primitive-color-brand-700);
4468
+ }
4469
+ }
4470
+ .ui\:has-checked\:not-has-disabled\:bg-background-neutral-secondary-hovered {
4471
+ &:has(*:checked) {
4472
+ &:not(*:has(*:disabled)) {
4473
+ background-color: var(
4474
+ --ui-primitive-color-brand-100
4475
+ );
4476
+ }
4477
+ }
4478
+ }
4479
+ .ui\:has-checked\:not-has-disabled\:ring-2 {
4480
+ &:has(*:checked) {
4481
+ &:not(*:has(*:disabled)) {
4482
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
4483
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
4484
+ }
4485
+ }
4486
+ }
4487
+ .ui\:hover\:has-checked\:not-has-disabled\:ring-border-brand-primary-hovered {
4488
+ &:hover {
4489
+ @media (hover: hover) {
4490
+ &:has(*:checked) {
4491
+ &:not(*:has(*:disabled)) {
4492
+ --tw-ring-color: var(--ui-primitive-color-brand-500);
4493
+ }
4494
+ }
4495
+ }
4496
+ }
4497
+ }
4498
+ .ui\:has-disabled\:ring-border-neutral-primary-disabled {
4499
+ &:has(*:disabled) {
4500
+ --tw-ring-color: var(--ui-primitive-color-grey-500);
4501
+ }
4502
+ }
4503
+ .ui\:has-disabled\:checked\:bg-background-brand-primary-disabled {
4504
+ &:has(*:disabled) {
4505
+ &:checked {
4506
+ background-color: var(--ui-primitive-color-grey-500);
4507
+ }
4508
+ }
4509
+ }
4420
4510
  .ui\:data-\[side\=bottom\]\:slide-in-from-top-2 {
4421
4511
  &[data-side="bottom"] {
4422
4512
  --tw-enter-translate-y: -0.5rem;