@luscii-healthtech/web-ui 59.1.0 → 60.0.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.
- package/dist/esm/components/Radio/LabeledRadio.js +11 -5
- package/dist/esm/components/Radio/LabeledRadio.js.map +1 -1
- package/dist/esm/components/RangeTriggerIcon/RangeTriggerIcon.js +45 -0
- package/dist/esm/components/RangeTriggerIcon/RangeTriggerIcon.js.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.development.js +52 -5
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/Radio/LabeledRadio.d.ts +14 -4
- package/dist/src/components/RangeTriggerIcon/RangeTriggerIcon.d.ts +39 -0
- package/dist/src/components/RangeTriggerIcon/index.d.ts +1 -0
- package/dist/src/generated/components/Radio/LabeledRadio.d.ts +14 -4
- package/dist/src/generated/components/RangeTriggerIcon/RangeTriggerIcon.d.ts +39 -0
- package/dist/src/generated/components/RangeTriggerIcon/index.d.ts +1 -0
- package/dist/src/generated/index.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/stories/LabeledRadio.stories.d.ts +4 -0
- package/dist/stories/RangeTriggerIcon.stories.d.ts +56 -0
- package/dist/web-ui-tailwind.css +8 -0
- package/package.json +1 -1
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = React.ComponentPropsWithRef<"input"> & {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Content that belongs to this option, rendered underneath it and lined
|
|
5
|
+
* up with the label, such as an extra input that appears when the option
|
|
6
|
+
* is selected. It is rendered outside of the `<label>`, so it can safely
|
|
7
|
+
* contain interactive elements without toggling the radio. Use `label` for
|
|
8
|
+
* the label of the radio itself.
|
|
9
|
+
*
|
|
10
|
+
* The radio's label does not label anything in `children`, so inputs in
|
|
11
|
+
* there need their own accessible name (e.g. `aria-label`). Children are not
|
|
12
|
+
* dimmed when the radio is `disabled`; that is up to the consumer.
|
|
13
|
+
* Best suited for vertical groups, as in a horizontal group the children
|
|
14
|
+
* widen the column of its option.
|
|
5
15
|
*/
|
|
6
16
|
children?: React.ReactNode;
|
|
7
17
|
/**
|
|
@@ -28,9 +38,9 @@ type Props = React.ComponentPropsWithRef<"input"> & {
|
|
|
28
38
|
*/
|
|
29
39
|
id: string;
|
|
30
40
|
/**
|
|
31
|
-
* The visual label next to the radio indicator.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
41
|
+
* The visual label next to the radio indicator. A string (or number) is
|
|
42
|
+
* rendered inside a `<Text>` component, any other node is rendered as-is,
|
|
43
|
+
* so it can be used for rich labels.
|
|
34
44
|
*/
|
|
35
45
|
label?: React.ReactNode;
|
|
36
46
|
/**
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, FC } from "react";
|
|
2
|
+
export declare const RANGE_TRIGGER_ICON_SHAPES: readonly ["upper", "lower", "middle", "full", "exact"];
|
|
3
|
+
export type RangeTriggerIconShape = (typeof RANGE_TRIGGER_ICON_SHAPES)[number];
|
|
4
|
+
export declare const RANGE_TRIGGER_ICON_COLORS: readonly ["alerts-high-salmon", "alerts-high-crimson", "alerts-high-red", "alerts-medium-sun", "alerts-medium-oak", "alerts-medium-amber", "alerts-low-mint", "alerts-low-leaf", "alerts-low-green", "alerts-neutral-fog", "alerts-neutral-neutral", "alerts-neutral-graphite"];
|
|
5
|
+
/**
|
|
6
|
+
* One of the alert colours of a priority (`alerts-<priority>-<name>`, from
|
|
7
|
+
* `color/icon/alerts/<priority>/<name>`).
|
|
8
|
+
*/
|
|
9
|
+
export type RangeTriggerIconColor = (typeof RANGE_TRIGGER_ICON_COLORS)[number];
|
|
10
|
+
export type RangeTriggerIconProps = Omit<ComponentPropsWithoutRef<"svg">, "color" | "children" | "fill" | "role" | "aria-hidden"> & {
|
|
11
|
+
/**
|
|
12
|
+
* Which part of the track the range covers: its `upper` or `lower` end, the
|
|
13
|
+
* `middle`, the `full` track, or `exact`ly one value (a dot in the middle).
|
|
14
|
+
*/
|
|
15
|
+
shape: RangeTriggerIconShape;
|
|
16
|
+
/**
|
|
17
|
+
* The colour of the range, one of the design system's alert colours.
|
|
18
|
+
* Without it, the range is brand primary (`color/icon/brand/primary/default`).
|
|
19
|
+
* The track's colour isn't configurable.
|
|
20
|
+
*/
|
|
21
|
+
color?: RangeTriggerIconColor;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the range in the disabled colour, whatever its `color`.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Shows which part of a range triggers an alert: a 40 × 24 track with the
|
|
30
|
+
* range drawn on it.
|
|
31
|
+
*
|
|
32
|
+
* Like other icons, it's decorative and hidden from assistive technology
|
|
33
|
+
* unless it has an accessible name (`aria-label` or `aria-labelledby`).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
*
|
|
37
|
+
* <RangeTriggerIcon shape="upper" color="alerts-high-crimson" />
|
|
38
|
+
*/
|
|
39
|
+
export declare const RangeTriggerIcon: FC<RangeTriggerIconProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RangeTriggerIcon";
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type Props = React.ComponentPropsWithRef<"input"> & {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Content that belongs to this option, rendered underneath it and lined
|
|
5
|
+
* up with the label, such as an extra input that appears when the option
|
|
6
|
+
* is selected. It is rendered outside of the `<label>`, so it can safely
|
|
7
|
+
* contain interactive elements without toggling the radio. Use `label` for
|
|
8
|
+
* the label of the radio itself.
|
|
9
|
+
*
|
|
10
|
+
* The radio's label does not label anything in `children`, so inputs in
|
|
11
|
+
* there need their own accessible name (e.g. `aria-label`). Children are not
|
|
12
|
+
* dimmed when the radio is `disabled`; that is up to the consumer.
|
|
13
|
+
* Best suited for vertical groups, as in a horizontal group the children
|
|
14
|
+
* widen the column of its option.
|
|
5
15
|
*/
|
|
6
16
|
children?: React.ReactNode;
|
|
7
17
|
/**
|
|
@@ -28,9 +38,9 @@ type Props = React.ComponentPropsWithRef<"input"> & {
|
|
|
28
38
|
*/
|
|
29
39
|
id: string;
|
|
30
40
|
/**
|
|
31
|
-
* The visual label next to the radio indicator.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
41
|
+
* The visual label next to the radio indicator. A string (or number) is
|
|
42
|
+
* rendered inside a `<Text>` component, any other node is rendered as-is,
|
|
43
|
+
* so it can be used for rich labels.
|
|
34
44
|
*/
|
|
35
45
|
label?: React.ReactNode;
|
|
36
46
|
/**
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, FC } from "react";
|
|
2
|
+
export declare const RANGE_TRIGGER_ICON_SHAPES: readonly ["upper", "lower", "middle", "full", "exact"];
|
|
3
|
+
export type RangeTriggerIconShape = (typeof RANGE_TRIGGER_ICON_SHAPES)[number];
|
|
4
|
+
export declare const RANGE_TRIGGER_ICON_COLORS: readonly ["alerts-high-salmon", "alerts-high-crimson", "alerts-high-red", "alerts-medium-sun", "alerts-medium-oak", "alerts-medium-amber", "alerts-low-mint", "alerts-low-leaf", "alerts-low-green", "alerts-neutral-fog", "alerts-neutral-neutral", "alerts-neutral-graphite"];
|
|
5
|
+
/**
|
|
6
|
+
* One of the alert colours of a priority (`alerts-<priority>-<name>`, from
|
|
7
|
+
* `color/icon/alerts/<priority>/<name>`).
|
|
8
|
+
*/
|
|
9
|
+
export type RangeTriggerIconColor = (typeof RANGE_TRIGGER_ICON_COLORS)[number];
|
|
10
|
+
export type RangeTriggerIconProps = Omit<ComponentPropsWithoutRef<"svg">, "color" | "children" | "fill" | "role" | "aria-hidden"> & {
|
|
11
|
+
/**
|
|
12
|
+
* Which part of the track the range covers: its `upper` or `lower` end, the
|
|
13
|
+
* `middle`, the `full` track, or `exact`ly one value (a dot in the middle).
|
|
14
|
+
*/
|
|
15
|
+
shape: RangeTriggerIconShape;
|
|
16
|
+
/**
|
|
17
|
+
* The colour of the range, one of the design system's alert colours.
|
|
18
|
+
* Without it, the range is brand primary (`color/icon/brand/primary/default`).
|
|
19
|
+
* The track's colour isn't configurable.
|
|
20
|
+
*/
|
|
21
|
+
color?: RangeTriggerIconColor;
|
|
22
|
+
/**
|
|
23
|
+
* Shows the range in the disabled colour, whatever its `color`.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Shows which part of a range triggers an alert: a 40 × 24 track with the
|
|
30
|
+
* range drawn on it.
|
|
31
|
+
*
|
|
32
|
+
* Like other icons, it's decorative and hidden from assistive technology
|
|
33
|
+
* unless it has an accessible name (`aria-label` or `aria-labelledby`).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
*
|
|
37
|
+
* <RangeTriggerIcon shape="upper" color="alerts-high-crimson" />
|
|
38
|
+
*/
|
|
39
|
+
export declare const RangeTriggerIcon: FC<RangeTriggerIconProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RangeTriggerIcon";
|
|
@@ -126,6 +126,7 @@ export { HoverIndicatorControl } from "./components/HoverIndicatorControl/HoverI
|
|
|
126
126
|
export { ActionController } from "./components/ActionController/ActionController";
|
|
127
127
|
export { Collapse } from "./components/Collapse/Collapse";
|
|
128
128
|
export { RangeCoverage } from "./components/RangeCoverage/RangeCoverage";
|
|
129
|
+
export { RangeTriggerIcon, type RangeTriggerIconProps, type RangeTriggerIconShape, type RangeTriggerIconColor, } from "./components/RangeTriggerIcon";
|
|
129
130
|
export { Skeleton } from "./components/Skeleton/Skeleton";
|
|
130
131
|
export { DetailsDisclosure } from "./components/DetailsDisclosure/DetailsDisclosure";
|
|
131
132
|
export { ModalDialog } from "./components/ModalDialog/ModalDialog";
|
package/dist/src/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export { HoverIndicatorControl } from "./components/HoverIndicatorControl/HoverI
|
|
|
126
126
|
export { ActionController } from "./components/ActionController/ActionController";
|
|
127
127
|
export { Collapse } from "./components/Collapse/Collapse";
|
|
128
128
|
export { RangeCoverage } from "./components/RangeCoverage/RangeCoverage";
|
|
129
|
+
export { RangeTriggerIcon, type RangeTriggerIconProps, type RangeTriggerIconShape, type RangeTriggerIconColor, } from "./components/RangeTriggerIcon";
|
|
129
130
|
export { Skeleton } from "./components/Skeleton/Skeleton";
|
|
130
131
|
export { DetailsDisclosure } from "./components/DetailsDisclosure/DetailsDisclosure";
|
|
131
132
|
export { ModalDialog } from "./components/ModalDialog/ModalDialog";
|
|
@@ -19,6 +19,9 @@ declare const meta: {
|
|
|
19
19
|
helperText: {
|
|
20
20
|
component: string;
|
|
21
21
|
};
|
|
22
|
+
description: {
|
|
23
|
+
component: string;
|
|
24
|
+
};
|
|
22
25
|
};
|
|
23
26
|
};
|
|
24
27
|
};
|
|
@@ -29,6 +32,7 @@ export declare const WithDifferentLabels: Story;
|
|
|
29
32
|
export declare const Disabled: Story;
|
|
30
33
|
export declare const CheckedAndDisabled: Story;
|
|
31
34
|
export declare const _LabeledRadioGroup: Story;
|
|
35
|
+
export declare const WithNestedContent: Story;
|
|
32
36
|
export declare const OverviewLabeledRadioCard: Story;
|
|
33
37
|
export declare const UsingLabelAndSubtitleProps: Story;
|
|
34
38
|
export declare const UsingChildrenPropForCustomContent: Story;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import RangeTriggerIconDocumentation from "./RangeTriggerIcon.docs.mdx";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC<import("../src").RangeTriggerIconProps>;
|
|
6
|
+
args: {
|
|
7
|
+
shape: "upper";
|
|
8
|
+
disabled: false;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
shape: {
|
|
12
|
+
control: "inline-radio";
|
|
13
|
+
options: readonly ["upper", "lower", "middle", "full", "exact"];
|
|
14
|
+
};
|
|
15
|
+
color: {
|
|
16
|
+
control: "select";
|
|
17
|
+
options: readonly ["alerts-high-salmon", "alerts-high-crimson", "alerts-high-red", "alerts-medium-sun", "alerts-medium-oak", "alerts-medium-amber", "alerts-low-mint", "alerts-low-leaf", "alerts-low-green", "alerts-neutral-fog", "alerts-neutral-neutral", "alerts-neutral-graphite"];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
parameters: {
|
|
21
|
+
docs: {
|
|
22
|
+
page: typeof RangeTriggerIconDocumentation;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
export declare const Default: Story;
|
|
29
|
+
/**
|
|
30
|
+
* Every variant from the Figma component set, in its default and disabled
|
|
31
|
+
* state.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FigmaVariants: Story;
|
|
34
|
+
/**
|
|
35
|
+
* Shape and colour are separate props, so every shape works in every colour,
|
|
36
|
+
* including combinations the Figma component set doesn't show.
|
|
37
|
+
*/
|
|
38
|
+
export declare const AllShapesAndColors: Story;
|
|
39
|
+
/**
|
|
40
|
+
* The alert colours of each priority. Use the `shape` control to see them in
|
|
41
|
+
* another shape.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ColorsByPriority: Story;
|
|
44
|
+
export declare const Disabled: Story;
|
|
45
|
+
/**
|
|
46
|
+
* The track is grey, not blue, so the icons keep their contrast on the
|
|
47
|
+
* background of a selected `LabeledRadioCard`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const OnSelectedBackground: Story;
|
|
50
|
+
/**
|
|
51
|
+
* Give the icon an accessible name (`aria-label` or `aria-labelledby`) when it
|
|
52
|
+
* conveys information that isn't available elsewhere. It's then exposed as an
|
|
53
|
+
* image with that name.
|
|
54
|
+
*/
|
|
55
|
+
export declare const WithAccessibleName: Story;
|
|
56
|
+
export declare const WithAccessibleNameFromLabelledBy: Story;
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -2035,6 +2035,10 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
2035
2035
|
--tw-border-spacing-y: 0px;
|
|
2036
2036
|
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
2037
2037
|
}
|
|
2038
|
+
.ui\:border-spacing-x-f_base {
|
|
2039
|
+
--tw-border-spacing-x: var(--ui-semantic-spacing-base);
|
|
2040
|
+
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
2041
|
+
}
|
|
2038
2042
|
.ui\:border-spacing-x-f_xl {
|
|
2039
2043
|
--tw-border-spacing-x: var(--ui-semantic-spacing-xl);
|
|
2040
2044
|
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
@@ -2043,6 +2047,10 @@ button, input:where([type='button'], [type='reset'], [type='submit']), ::file-se
|
|
|
2043
2047
|
--tw-border-spacing-y: var(--ui-semantic-spacing-base);
|
|
2044
2048
|
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
2045
2049
|
}
|
|
2050
|
+
.ui\:border-spacing-y-f_s {
|
|
2051
|
+
--tw-border-spacing-y: var(--ui-semantic-spacing-s);
|
|
2052
|
+
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
|
|
2053
|
+
}
|
|
2046
2054
|
.ui\:origin-\[0_55\%\] {
|
|
2047
2055
|
transform-origin: 0 55%;
|
|
2048
2056
|
}
|