@luscii-healthtech/web-ui 44.0.0 → 44.1.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.
@@ -65,4 +65,17 @@ export interface CheckboxProps {
65
65
  */
66
66
  renderLabel?: (props: CheckboxProps) => JSX.Element | null;
67
67
  }
68
+ /**
69
+ * @deprecated - use `LabeledCheckbox` components in a `LabeledCheckboxGroup` instead.
70
+ *
71
+ * E.g. with React Hook Form:
72
+ *
73
+ * @example
74
+ * ```tsx
75
+ * <LabeledCheckboxGroup>
76
+ * <LabeledCheckbox {...register("orderedMeals")} label="Anchovies pasta" value="anchovies-pasta" />
77
+ * <LabeledCheckbox {...register("orderedMeals")} label="Banana dessert" value="banana-dessert" />
78
+ * </LabeledCheckboxGroup>
79
+ * ```
80
+ */
68
81
  export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ type Props = React.ComponentPropsWithRef<"input"> & {
3
+ /**
4
+ * The visual label next to the checkbox indicator.
5
+ */
6
+ children?: React.ReactNode;
7
+ /**
8
+ * Additional classes to apply to the checkbox input HTML element.
9
+ */
10
+ inputClassName?: string;
11
+ /**
12
+ * Making `id` required, since it's important for accessibility.
13
+ */
14
+ id: string;
15
+ /**
16
+ * The visual label next to the checkbox indicator.
17
+ * Alternative to `children` for when it's easier to just pass
18
+ * a string as a prop. Will be rendered inside a `<Text>` component.
19
+ */
20
+ label?: React.ReactNode;
21
+ /**
22
+ * Any additional information to show underneath the label.
23
+ */
24
+ helperText?: React.ReactNode;
25
+ /**
26
+ * An error message that should be shown when there's something wrong
27
+ * with the user's input.
28
+ */
29
+ 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 {};
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ type Props = {
3
+ children: React.ReactNode;
4
+ title?: string;
5
+ className?: string;
6
+ /**
7
+ * Any additional information to show underneath the radio group.
8
+ */
9
+ helperText?: React.ReactNode;
10
+ /**
11
+ * An error message that should be shown when there's something wrong
12
+ * with the user's input.
13
+ */
14
+ errorText?: React.ReactNode;
15
+ };
16
+ /**
17
+ * This component is used to group radio buttons together with a title, and provide
18
+ * a semantic helper and error text to the group. It requires children to function,
19
+ * in practice these are always `LabeledCheckbox` components (as opposed to `LabeledCheckbox`
20
+ * and `LabeledInput`, which provide the HTML `input` element themselves).
21
+ */
22
+ export declare const LabeledCheckboxGroup: React.FC<Props>;
23
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ export declare const StyledCheckbox: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
3
+ 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;
4
+ }, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -30,6 +30,8 @@ export { TertiaryIconButton } from "./components/ButtonV2/TertiaryIconButton";
30
30
  export { default as Carousel } from "./components/Carousel/Carousel";
31
31
  export { default as CenteredHero } from "./components/CenteredHero/CenteredHero";
32
32
  export { Checkbox } from "./components/Checkbox/Checkbox";
33
+ export { LabeledCheckbox } from "./components/Checkbox/LabeledCheckbox";
34
+ export { LabeledCheckboxGroup } from "./components/Checkbox/LabeledCheckboxGroup";
33
35
  export { Chip } from "./components/Chip/Chip";
34
36
  export { ConfirmationDialog } from "./components/ConfirmationDialog/ConfirmationDialog";
35
37
  export type { ConfirmationDialogChoice, ConfirmationDialogProps, ConfirmationDialogTitleProps, } from "./components/ConfirmationDialog/types/ConfirmationDialog.types";
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import { type StoryObj } from "@storybook/react-vite";
3
+ declare const meta: {
4
+ title: string;
5
+ component: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & {
6
+ 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;
7
+ } & {
8
+ children?: React.ReactNode;
9
+ inputClassName?: string;
10
+ id: string;
11
+ label?: React.ReactNode;
12
+ helperText?: React.ReactNode;
13
+ errorText?: React.ReactNode;
14
+ }, "ref"> & React.RefAttributes<HTMLInputElement>>;
15
+ parameters: {
16
+ backgrounds: {
17
+ default: string;
18
+ };
19
+ docs: {
20
+ helperText: {
21
+ component: string;
22
+ };
23
+ };
24
+ };
25
+ };
26
+ export default meta;
27
+ type Story = StoryObj<typeof meta>;
28
+ export declare const Base: Story;
29
+ export declare const Overview: Story;
30
+ export declare const Disabled: Story;
31
+ export declare const MultipleCheckboxes: Story;
32
+ export declare const WithHelperAndErrorText: Story;
@@ -2024,6 +2024,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2024
2024
  .ui\:border-black {
2025
2025
  border-color: var(--ui-color-black);
2026
2026
  }
2027
+ .ui\:border-border-neutral-primary-default {
2028
+ border-color: var(--ui-primitive-color-grey-700);
2029
+ }
2027
2030
  .ui\:border-border-success-primary-default {
2028
2031
  border-color: var(--ui-primitive-color-green-700);
2029
2032
  }
@@ -2907,6 +2910,9 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
2907
2910
  .ui\:text-text-error-primary-default {
2908
2911
  color: var(--ui-primitive-color-red-900);
2909
2912
  }
2913
+ .ui\:text-text-neutral-secondary-disabled {
2914
+ color: var(--ui-primitive-color-grey-500);
2915
+ }
2910
2916
  .ui\:text-transparent {
2911
2917
  color: transparent;
2912
2918
  }
@@ -3413,18 +3419,36 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3413
3419
  left: 0px;
3414
3420
  }
3415
3421
  }
3422
+ .ui\:before\:block {
3423
+ &::before {
3424
+ content: var(--tw-content);
3425
+ display: block;
3426
+ }
3427
+ }
3416
3428
  .ui\:before\:h-1\.5 {
3417
3429
  &::before {
3418
3430
  content: var(--tw-content);
3419
3431
  height: 0.375rem;
3420
3432
  }
3421
3433
  }
3434
+ .ui\:before\:h-full {
3435
+ &::before {
3436
+ content: var(--tw-content);
3437
+ height: 100%;
3438
+ }
3439
+ }
3422
3440
  .ui\:before\:w-1\.5 {
3423
3441
  &::before {
3424
3442
  content: var(--tw-content);
3425
3443
  width: 0.375rem;
3426
3444
  }
3427
3445
  }
3446
+ .ui\:before\:w-full {
3447
+ &::before {
3448
+ content: var(--tw-content);
3449
+ width: 100%;
3450
+ }
3451
+ }
3428
3452
  .ui\:before\:w-m {
3429
3453
  &::before {
3430
3454
  content: var(--tw-content);
@@ -3505,6 +3529,24 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3505
3529
  background-color: var(--ui-color-white);
3506
3530
  }
3507
3531
  }
3532
+ .ui\:before\:bg-\[url\(\'data\:image\/svg\+xml\;utf8\,\%3Csvg\%20width\%3D\%2214\%22\%20height\%3D\%2211\%22\%20viewBox\%3D\%220\%200\%2014\%2011\%22\%20fill\%3D\%22none\%22\%20xmlns\%3D\%22http\%3A\%2F\%2Fwww\.w3\.org\%2F2000\%2Fsvg\%22\%3E\%3Cpath\%20d\%3D\%22M13\.0421\%200\.43918C13\.3233\%200\.720471\%2013\.4812\%201\.10193\%2013\.4812\%201\.49968C13\.4812\%201\.89743\%2013\.3233\%202\.27889\%2013\.0421\%202\.56018L5\.54207\%2010\.0602C5\.26078\%2010\.3414\%204\.87931\%2010\.4994\%204\.48157\%2010\.4994C4\.08382\%2010\.4994\%203\.70236\%2010\.3414\%203\.42107\%2010\.0602L0\.421068\%207\.06018C0\.147831\%206\.77728\%20-0\.00336092\%206\.39837\%205\.6704e-05\%206\.00508C0\.00347433\%205\.61178\%200\.161228\%205\.23556\%200\.43934\%204\.95745C0\.717452\%204\.67934\%201\.09367\%204\.52159\%201\.48697\%204\.51817C1\.88026\%204\.51475\%202\.25916\%204\.66594\%202\.54207\%204\.93918L4\.48157\%206\.87868L10\.9211\%200\.43918C11\.2024\%200\.157973\%2011\.5838\%200\%2011\.9816\%200C12\.3793\%200\%2012\.7608\%200\.157973\%2013\.0421\%200\.43918Z\%22\%20fill\%3D\%22white\%22\%2F\%3E\%3C\%2Fsvg\%3E\'\)\] {
3533
+ &::before {
3534
+ content: var(--tw-content);
3535
+ background-image: url('data:image/svg+xml;utf8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.0421%200.43918C13.3233%200.720471%2013.4812%201.10193%2013.4812%201.49968C13.4812%201.89743%2013.3233%202.27889%2013.0421%202.56018L5.54207%2010.0602C5.26078%2010.3414%204.87931%2010.4994%204.48157%2010.4994C4.08382%2010.4994%203.70236%2010.3414%203.42107%2010.0602L0.421068%207.06018C0.147831%206.77728%20-0.00336092%206.39837%205.6704e-05%206.00508C0.00347433%205.61178%200.161228%205.23556%200.43934%204.95745C0.717452%204.67934%201.09367%204.52159%201.48697%204.51817C1.88026%204.51475%202.25916%204.66594%202.54207%204.93918L4.48157%206.87868L10.9211%200.43918C11.2024%200.157973%2011.5838%200%2011.9816%200C12.3793%200%2012.7608%200.157973%2013.0421%200.43918Z%22%20fill%3D%22white%22%2F%3E%3C%2Fsvg%3E');
3536
+ }
3537
+ }
3538
+ .ui\:before\:bg-center {
3539
+ &::before {
3540
+ content: var(--tw-content);
3541
+ background-position: center;
3542
+ }
3543
+ }
3544
+ .ui\:before\:bg-no-repeat {
3545
+ &::before {
3546
+ content: var(--tw-content);
3547
+ background-repeat: no-repeat;
3548
+ }
3549
+ }
3508
3550
  .ui\:before\:opacity-0 {
3509
3551
  &::before {
3510
3552
  content: var(--tw-content);
@@ -3517,6 +3559,14 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3517
3559
  opacity: 100%;
3518
3560
  }
3519
3561
  }
3562
+ .ui\:before\:transition-\[scale\] {
3563
+ &::before {
3564
+ content: var(--tw-content);
3565
+ transition-property: scale;
3566
+ transition-timing-function: var(--tw-ease, var(--ui-default-transition-timing-function));
3567
+ transition-duration: var(--tw-duration, var(--ui-default-transition-duration));
3568
+ }
3569
+ }
3520
3570
  .ui\:before\:transition-transform {
3521
3571
  &::before {
3522
3572
  content: var(--tw-content);
@@ -3545,6 +3595,13 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3545
3595
  transition-duration: 200ms;
3546
3596
  }
3547
3597
  }
3598
+ .ui\:before\:ease-\[cubic-bezier\(\.17\,\.67\,\.16\,1\.5\)\] {
3599
+ &::before {
3600
+ content: var(--tw-content);
3601
+ --tw-ease: cubic-bezier(.17,.67,.16,1.5);
3602
+ transition-timing-function: cubic-bezier(.17,.67,.16,1.5);
3603
+ }
3604
+ }
3548
3605
  .ui\:before\:ease-\[cubic-bezier\(\.47\,\.34\,\.52\,1\.39\)\] {
3549
3606
  &::before {
3550
3607
  content: var(--tw-content);
@@ -3603,6 +3660,12 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3603
3660
  animation-duration: 200ms;
3604
3661
  }
3605
3662
  }
3663
+ .ui\:before\:ease-\[cubic-bezier\(\.17\,\.67\,\.16\,1\.5\)\] {
3664
+ &::before {
3665
+ content: var(--tw-content);
3666
+ animation-timing-function: cubic-bezier(.17,.67,.16,1.5);
3667
+ }
3668
+ }
3606
3669
  .ui\:before\:ease-\[cubic-bezier\(\.47\,\.34\,\.52\,1\.39\)\] {
3607
3670
  &::before {
3608
3671
  content: var(--tw-content);
@@ -3856,11 +3919,21 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3856
3919
  place-content: center;
3857
3920
  }
3858
3921
  }
3922
+ .ui\:checked\:border-border-brand-primary-default {
3923
+ &:checked {
3924
+ border-color: var(--ui-primitive-color-brand-700);
3925
+ }
3926
+ }
3859
3927
  .ui\:checked\:border-primary {
3860
3928
  &:checked {
3861
3929
  border-color: var(--ui-color-blue-800);
3862
3930
  }
3863
3931
  }
3932
+ .ui\:checked\:bg-icon-brand-primary-default {
3933
+ &:checked {
3934
+ background-color: var(--ui-primitive-color-brand-700);
3935
+ }
3936
+ }
3864
3937
  .ui\:checked\:bg-primary {
3865
3938
  &:checked {
3866
3939
  background-color: var(--ui-color-blue-800);
@@ -3881,6 +3954,13 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
3881
3954
  }
3882
3955
  }
3883
3956
  }
3957
+ .ui\:hover\:border-border-neutral-primary-hovered {
3958
+ &:hover {
3959
+ @media (hover: hover) {
3960
+ border-color: var(--ui-primitive-color-brand-500);
3961
+ }
3962
+ }
3963
+ }
3884
3964
  .ui\:hover\:border-input-border-dark {
3885
3965
  &:hover {
3886
3966
  @media (hover: hover) {
@@ -4135,6 +4215,15 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4135
4215
  }
4136
4216
  }
4137
4217
  }
4218
+ .ui\:checked\:hover\:bg-icon-brand-primary-hover {
4219
+ &:checked {
4220
+ &:hover {
4221
+ @media (hover: hover) {
4222
+ background-color: var(--ui-primitive-color-brand-500);
4223
+ }
4224
+ }
4225
+ }
4226
+ }
4138
4227
  .ui\:focus\:z-\[4\] {
4139
4228
  &:focus {
4140
4229
  z-index: 4;
@@ -4311,6 +4400,23 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4311
4400
  transition-duration: var(--tw-duration, var(--ui-default-transition-duration));
4312
4401
  }
4313
4402
  }
4403
+ .ui\:disabled\:cursor-not-allowed {
4404
+ &:disabled {
4405
+ cursor: not-allowed;
4406
+ }
4407
+ }
4408
+ .ui\:disabled\:border-border-neutral-primary-disabled {
4409
+ &:disabled {
4410
+ border-color: var(--ui-primitive-color-grey-500);
4411
+ }
4412
+ }
4413
+ .ui\:disabled\:checked\:bg-background-brand-primary-disabled {
4414
+ &:disabled {
4415
+ &:checked {
4416
+ background-color: var(--ui-primitive-color-grey-500);
4417
+ }
4418
+ }
4419
+ }
4314
4420
  .ui\:data-\[side\=bottom\]\:slide-in-from-top-2 {
4315
4421
  &[data-side="bottom"] {
4316
4422
  --tw-enter-translate-y: -0.5rem;
@@ -4494,6 +4600,11 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
4494
4600
  margin-top: calc(var(--ui-spacing) * 0);
4495
4601
  }
4496
4602
  }
4603
+ .ui\:sm\:mt-\[2px\] {
4604
+ @media (width >= 40rem) {
4605
+ margin-top: 2px;
4606
+ }
4607
+ }
4497
4608
  .ui\:sm\:ml-4 {
4498
4609
  @media (width >= 40rem) {
4499
4610
  margin-left: calc(var(--ui-spacing) * 4);