@raspberrypifoundation/design-system-react 2.7.3 → 2.9.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.
Files changed (45) hide show
  1. package/README.md +16 -7
  2. package/dist/design-system-react.css +1 -1
  3. package/dist/design-system-react.js +3284 -830
  4. package/dist/design-system-react.umd.cjs +16 -13
  5. package/dist/scss/components/switch.scss +179 -0
  6. package/dist/scss/design-system-core.scss +3 -2
  7. package/dist/scss/properties/colors/_greys.scss +1 -0
  8. package/dist/scss/utility/_visually-hidden.scss +11 -0
  9. package/dist/types/lib/main.d.ts +10 -0
  10. package/dist/types/lib/main.d.ts.map +1 -1
  11. package/dist/types/src/components/Button/index.d.ts.map +1 -1
  12. package/dist/types/src/components/Form/Switch/Switch.spec.d.ts +2 -0
  13. package/dist/types/src/components/Form/Switch/Switch.spec.d.ts.map +1 -0
  14. package/dist/types/src/components/Form/Switch/Switch.types.d.ts +24 -0
  15. package/dist/types/src/components/Form/Switch/Switch.types.d.ts.map +1 -0
  16. package/dist/types/src/components/Form/Switch/index.d.ts +16 -0
  17. package/dist/types/src/components/Form/Switch/index.d.ts.map +1 -0
  18. package/dist/types/src/components/Menu/Menu.types.d.ts +6 -0
  19. package/dist/types/src/components/Menu/Menu.types.d.ts.map +1 -0
  20. package/dist/types/src/components/Menu/MenuButton/MenuButton.types.d.ts +7 -0
  21. package/dist/types/src/components/Menu/MenuButton/MenuButton.types.d.ts.map +1 -0
  22. package/dist/types/src/components/Menu/MenuButton/index.d.ts +4 -0
  23. package/dist/types/src/components/Menu/MenuButton/index.d.ts.map +1 -0
  24. package/dist/types/src/components/Menu/MenuItem/MenuItem.types.d.ts +11 -0
  25. package/dist/types/src/components/Menu/MenuItem/MenuItem.types.d.ts.map +1 -0
  26. package/dist/types/src/components/Menu/MenuItem/index.d.ts +6 -0
  27. package/dist/types/src/components/Menu/MenuItem/index.d.ts.map +1 -0
  28. package/dist/types/src/components/Menu/MenuTitle/MenuTitle.types.d.ts +4 -0
  29. package/dist/types/src/components/Menu/MenuTitle/MenuTitle.types.d.ts.map +1 -0
  30. package/dist/types/src/components/Menu/MenuTitle/index.d.ts +5 -0
  31. package/dist/types/src/components/Menu/MenuTitle/index.d.ts.map +1 -0
  32. package/dist/types/src/components/Menu/index.d.ts +5 -0
  33. package/dist/types/src/components/Menu/index.d.ts.map +1 -0
  34. package/dist/types/src/stories/Menu/Menu.stories.d.ts +8 -0
  35. package/dist/types/src/stories/Menu/Menu.stories.d.ts.map +1 -0
  36. package/dist/types/src/stories/Menu/MenuButton.stories.d.ts +7 -0
  37. package/dist/types/src/stories/Menu/MenuButton.stories.d.ts.map +1 -0
  38. package/dist/types/src/stories/Menu/MenuItem.stories.d.ts +9 -0
  39. package/dist/types/src/stories/Menu/MenuItem.stories.d.ts.map +1 -0
  40. package/dist/types/src/stories/Menu/MenuTitle.stories.d.ts +7 -0
  41. package/dist/types/src/stories/Menu/MenuTitle.stories.d.ts.map +1 -0
  42. package/dist/types/src/stories/forms/Switch.stories.d.ts +54 -0
  43. package/dist/types/src/stories/forms/Switch.stories.d.ts.map +1 -0
  44. package/package.json +18 -13
  45. package/CHANGELOG.md +0 -334
@@ -12,19 +12,18 @@
12
12
  @use 'properties/colors/_text';
13
13
  @use 'properties/colors/_utilities';
14
14
 
15
-
16
15
  @use 'components/alert';
17
16
  @use 'components/accordion';
18
17
  @use 'components/button';
19
18
  @use 'components/progress-bar';
20
19
  @use 'components/squiggle';
21
20
  @use 'components/tag';
21
+ @use 'components/switch';
22
22
  @use 'components/menu';
23
23
  @use 'components/link';
24
24
  @use 'components/burger-menu';
25
25
  @use 'components/modal';
26
26
 
27
-
28
27
  @use 'components/forms/error-message';
29
28
  @use 'components/forms/fieldset';
30
29
  @use 'components/forms/inputs';
@@ -39,3 +38,5 @@
39
38
 
40
39
  @use 'components/table/table';
41
40
  @use 'components/table/table-cell';
41
+
42
+ @use 'utility/visually-hidden';
@@ -1,6 +1,7 @@
1
1
  :root, :host {
2
2
  --rpf-white: hsla(0, 0%, 100%, 1);
3
3
  --rpf-off-white: hsla(225, 25%, 97%, 1);
4
+ --rpf-off-white-warm: hsla(36, 38.5%, 97.5%, 1);
4
5
  --rpf-grey-50: hsla(210, 8%, 95%, 1);
5
6
  --rpf-grey-100: hsla(228, 10%, 90%, 1);
6
7
  --rpf-grey-150: hsla(223, 9%, 85%, 1);
@@ -0,0 +1,11 @@
1
+ .rpf-visually-hidden {
2
+ // https://www.a11y-collective.com/blog/visually-hidden/
3
+ border: 0;
4
+ clip-path: inset(50%);
5
+ inline-size: 1px;
6
+ block-size: 1px;
7
+ margin: 0;
8
+ overflow: hidden;
9
+ position: absolute;
10
+ white-space: nowrap;
11
+ }
@@ -17,12 +17,22 @@ export { default as SearchInput } from "../src/components/Form/SearchInput";
17
17
  export type { SearchInputProps } from "../src/components/Form/SearchInput/SearchInput.types";
18
18
  export { default as SelectInput } from "../src/components/Form/SelectInput";
19
19
  export type { SelectInputProps } from "../src/components/Form/SelectInput/SelectInput.types";
20
+ export { default as Switch } from "../src/components/Form/Switch";
21
+ export type { SwitchProps } from "../src/components/Form/Switch/Switch.types";
20
22
  export { default as TextareaInput } from "../src/components/Form/TextareaInput";
21
23
  export type { TextareaInputProps } from "../src/components/Form/TextareaInput/TextareaInput.types";
22
24
  export { default as TextInput } from "../src/components/Form/TextInput";
23
25
  export type { TextInputProps } from "../src/components/Form/TextInput/TextInput.types";
24
26
  export { default as Modal } from "../src/components/Modal";
25
27
  export type { ModalProps } from "../src/components/Modal/Modal.types";
28
+ export { default as Menu } from "../src/components/Menu";
29
+ export type { MenuProps } from "../src/components/Menu/Menu.types";
30
+ export { default as MenuButton } from "../src/components/Menu/MenuButton";
31
+ export type { MenuButtonProps } from "../src/components/Menu/MenuButton/MenuButton.types";
32
+ export { default as MenuItem } from "../src/components/Menu/MenuItem";
33
+ export type { MenuItemProps } from "../src/components/Menu/MenuItem/MenuItem.types";
34
+ export { default as MenuTitle } from "../src/components/Menu/MenuTitle";
35
+ export type { MenuTitleProps } from "../src/components/Menu/MenuTitle/MenuTitle.types";
26
36
  export { default as ProgressBar } from "../src/components/ProgressBar";
27
37
  export type { ProgressBarProps } from "../src/components/ProgressBar/ProgressBar.types";
28
38
  export { default as TableBodyCell } from "../src/components/Table/BodyCell";
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../lib/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAChF,YAAY,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAC5E,YAAY,EAAE,gBAAgB,E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"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAGtC,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,GAAI,4JAgBpB,WAAW,4CAgFb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAGtC,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,eAAO,MAAM,MAAM,GAAI,4JAgBpB,WAAW,4CA6Eb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Switch.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Switch/Switch.spec.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ export type SwitchProps = {
3
+ /** Unique identifier for the switch input */
4
+ id: string;
5
+ /** Name attribute for the switch input */
6
+ name: string;
7
+ /** Label text or `ReactNode` for the switch */
8
+ label: string | ReactNode;
9
+ /** Error message to display */
10
+ error?: string;
11
+ /** Stretch the switch across the available width */
12
+ fullWidth?: boolean;
13
+ /** Place the label before the track */
14
+ reverse?: boolean;
15
+ /** Hint text shown below the label */
16
+ hint?: string;
17
+ /** Align switch content to the start of the cross axis */
18
+ alignStart?: boolean;
19
+ /** Visually hide the label while keeping it accessible to screen readers */
20
+ hideLabel?: boolean;
21
+ /** Show on/off icons in the handle */
22
+ icon?: boolean;
23
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "id" | "name">;
24
+ //# sourceMappingURL=Switch.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Switch/Switch.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACxB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import "@/components/MaterialSymbols";
2
+ import "./Switch.scss";
3
+ export declare const Switch: import("react").ForwardRefExoticComponent<{
4
+ id: string;
5
+ name: string;
6
+ label: string | import("react").ReactNode;
7
+ error?: string;
8
+ fullWidth?: boolean;
9
+ reverse?: boolean;
10
+ hint?: string;
11
+ alignStart?: boolean;
12
+ hideLabel?: boolean;
13
+ icon?: boolean;
14
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "id" | "type" | "name"> & import("react").RefAttributes<HTMLInputElement>>;
15
+ export default Switch;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Form/Switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAItC,OAAO,eAAe,CAAC;AAGvB,eAAO,MAAM,MAAM;;;;;;;;;;;0IA4ElB,CAAC;AAIF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from "react";
2
+ export type MenuProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ };
6
+ //# sourceMappingURL=Menu.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/Menu.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ export type MenuButtonProps = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ buttonText?: string;
6
+ };
7
+ //# sourceMappingURL=MenuButton.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButton.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuButton/MenuButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { MenuButtonProps } from "./MenuButton.types";
2
+ export declare const MenuButton: ({ className, children, buttonText, }: MenuButtonProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default MenuButton;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuButton/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAkD1D,eAAO,MAAM,UAAU,GAAI,sCAIxB,eAAe,4CAQjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { MouseEventHandler } from "react";
2
+ export type MenuItemProps = {
3
+ text: string;
4
+ href?: string;
5
+ danger?: boolean;
6
+ icon?: string;
7
+ iconPosition?: "left" | "right";
8
+ className?: string;
9
+ onClick?: MouseEventHandler<HTMLButtonElement>;
10
+ };
11
+ //# sourceMappingURL=MenuItem.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuItem.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuItem/MenuItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;CAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import "@/components/MaterialSymbols";
2
+ import "./MenuItem.scss";
3
+ import type { MenuItemProps } from "./MenuItem.types";
4
+ export declare const MenuItem: ({ text, href, icon, iconPosition, danger, className, onClick, }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ export default MenuItem;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AAItC,OAAO,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAmBtD,eAAO,MAAM,QAAQ,GAAI,iEAQtB,aAAa,4CAoBf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type MenuTitleProps = {
2
+ text: string;
3
+ };
4
+ //# sourceMappingURL=MenuTitle.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuTitle.types.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuTitle/MenuTitle.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "./MenuTitle.scss";
2
+ import type { MenuTitleProps } from "./MenuTitle.types";
3
+ export declare const MenuTitle: ({ text }: MenuTitleProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default MenuTitle;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Menu/MenuTitle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,SAAS,GAAI,UAAU,cAAc,4CAIjD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "./Menu.scss";
2
+ import type { MenuProps } from "./Menu.types";
3
+ export declare const Menu: ({ className, children }: MenuProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default Menu;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,IAAI,GAAI,yBAAyB,SAAS,4CAItD,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Menu } from "../../components/Menu";
3
+ declare const meta: Meta<typeof Menu>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Menu>;
6
+ export declare const Default: Story;
7
+ export declare const WithTitleAndIcons: Story;
8
+ //# sourceMappingURL=Menu.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Menu/Menu.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAI7C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAO3B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAe/B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { MenuButton } from "../../components/Menu/MenuButton";
3
+ declare const meta: Meta<typeof MenuButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MenuButton>;
6
+ export declare const Default: Story;
7
+ //# sourceMappingURL=MenuButton.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Menu/MenuButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA2CjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { MenuItem } from "../../components/Menu/MenuItem";
3
+ declare const meta: Meta<typeof MenuItem>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MenuItem>;
6
+ export declare const Default: Story;
7
+ export declare const Link: Story;
8
+ export declare const Icon: Story;
9
+ //# sourceMappingURL=MenuItem.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuItem.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Menu/MenuItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAqB/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEvC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { MenuTitle } from "../../components/Menu/MenuTitle";
3
+ declare const meta: Meta<typeof MenuTitle>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MenuTitle>;
6
+ export declare const Default: Story;
7
+ //# sourceMappingURL=MenuTitle.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MenuTitle.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/Menu/MenuTitle.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAOhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Switch } from "../../components/Form/Switch";
3
+ declare const meta: Meta<typeof Switch>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Switch>;
6
+ /**
7
+ * Switches allow users to change a setting between two states.
8
+ */
9
+ export declare const Default: Story;
10
+ /**
11
+ * Checked switch state.
12
+ */
13
+ export declare const Checked: Story;
14
+ /**
15
+ * Disabled switch state.
16
+ */
17
+ export declare const Disabled: Story;
18
+ /**
19
+ * Disabled and checked switch state.
20
+ */
21
+ export declare const DisabledChecked: Story;
22
+ /**
23
+ * Switch with on/off icons in the handle.
24
+ */
25
+ export declare const WithIcon: Story;
26
+ /**
27
+ * Full width switch layout.
28
+ */
29
+ export declare const FullWidth: Story;
30
+ /**
31
+ * Label appears before the track.
32
+ */
33
+ export declare const Reverse: Story;
34
+ /**
35
+ * Full width switch with reversed label placement.
36
+ */
37
+ export declare const FullWidthAndReverse: Story;
38
+ /**
39
+ * Switch with hint text below the label.
40
+ */
41
+ export declare const WithHint: Story;
42
+ /**
43
+ * Align switch content to the start when the label wraps over multiple lines.
44
+ */
45
+ export declare const AlignStart: Story;
46
+ /**
47
+ * Visually hidden label; the name remains available to screen readers.
48
+ */
49
+ export declare const HiddenLabel: Story;
50
+ /**
51
+ * Providing an error string highlights an issue with the field.
52
+ */
53
+ export declare const Error: Story;
54
+ //# sourceMappingURL=Switch.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.stories.d.ts","sourceRoot":"","sources":["../../../../../src/stories/forms/Switch.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AA6FtD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAuC7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAA0B,CAAC;AAEjD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAYtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAY7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAwD,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,KAGvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAA8D,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAGjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,KAGtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAkE,CAAC;AAE7F;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAcnB,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "@raspberrypifoundation/design-system-react",
3
- "version": "2.7.3",
3
+ "version": "2.9.0",
4
4
  "type": "module",
5
5
  "main": "./dist/design-system-react.umd.cjs",
6
6
  "module": "./dist/design-system-react.js",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
- "sideEffects": false,
10
+ "sideEffects": [
11
+ "dist/design-system-react.css"
12
+ ],
11
13
  "exports": {
12
14
  ".": {
13
15
  "types": "./dist/types/lib/main.d.ts",
14
16
  "require": "./dist/design-system-react.umd.cjs",
15
17
  "import": "./dist/design-system-react.js"
16
18
  },
19
+ "./styles.css": "./dist/design-system-react.css",
17
20
  "./scss/*": "./dist/scss/*.scss",
18
21
  "./scss": "./dist/scss/design-system-core.scss",
19
22
  "./package.json": "./package.json",
@@ -40,20 +43,22 @@
40
43
  "ts:watch": "tsc --noEmit --watch"
41
44
  },
42
45
  "dependencies": {
43
- "@raspberrypifoundation/design-system-core": "^2.4.0",
46
+ "@raspberrypifoundation/design-system-core": "^2.4.5",
44
47
  "classnames": "^2.5.1",
45
48
  "lucide-react": "^0.553.0"
46
49
  },
47
50
  "devDependencies": {
48
51
  "@eslint/js": "^9.15.0",
49
- "@storybook/addon-essentials": "^8.6.11",
50
- "@storybook/addon-interactions": "^8.6.11",
51
- "@storybook/addon-onboarding": "^8.6.11",
52
- "@storybook/blocks": "^8.6.11",
53
- "@storybook/preview-api": "^8.6.11",
54
- "@storybook/react": "^8.6.11",
55
- "@storybook/react-vite": "^8.6.11",
56
- "@storybook/test": "^8.6.11",
52
+ "@floating-ui/react": "^0.26.19",
53
+ "@storybook/addon-a11y": "8.6.15",
54
+ "@storybook/addon-essentials": "8.6.15",
55
+ "@storybook/addon-interactions": "8.6.15",
56
+ "@storybook/addon-onboarding": "8.6.15",
57
+ "@storybook/blocks": "8.6.15",
58
+ "@storybook/preview-api": "8.6.15",
59
+ "@storybook/react": "8.6.15",
60
+ "@storybook/react-vite": "8.6.15",
61
+ "@storybook/test": "8.6.15",
57
62
  "@testing-library/dom": "^10.4.1",
58
63
  "@testing-library/jest-dom": "^6.6.3",
59
64
  "@testing-library/react": "^16.1.0",
@@ -79,7 +84,7 @@
79
84
  "react-dom": "^18.3.1",
80
85
  "react-router-dom": "^6.24.0",
81
86
  "sass-embedded": "^1.83.1",
82
- "storybook": "^8.6.11",
87
+ "storybook": "^8.6.18",
83
88
  "typescript": "^5.9.2",
84
89
  "vite": "^6.2.4",
85
90
  "vitest": "^3.1.1"
@@ -103,4 +108,4 @@
103
108
  "plugin:storybook/recommended"
104
109
  ]
105
110
  }
106
- }
111
+ }