@raspberrypifoundation/design-system-react 2.6.0 → 2.6.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +21 -0
  3. package/dist/design-system-react.js +675 -739
  4. package/dist/design-system-react.umd.cjs +6 -6
  5. package/dist/types/lib/main.d.ts +6 -0
  6. package/dist/types/lib/main.d.ts.map +1 -1
  7. package/dist/types/src/components/Alert/Alert.types.d.ts +41 -0
  8. package/dist/types/src/components/Alert/Alert.types.d.ts.map +1 -0
  9. package/dist/types/src/components/Alert/index.d.ts +4 -25
  10. package/dist/types/src/components/Alert/index.d.ts.map +1 -1
  11. package/dist/types/src/components/Button/Button.types.d.ts +34 -0
  12. package/dist/types/src/components/Button/Button.types.d.ts.map +1 -0
  13. package/dist/types/src/components/Button/index.d.ts +4 -37
  14. package/dist/types/src/components/Button/index.d.ts.map +1 -1
  15. package/dist/types/src/components/Form/CheckboxInput/CheckboxInput.types.d.ts +24 -0
  16. package/dist/types/src/components/Form/CheckboxInput/CheckboxInput.types.d.ts.map +1 -0
  17. package/dist/types/src/components/Form/CheckboxInput/index.d.ts +4 -25
  18. package/dist/types/src/components/Form/CheckboxInput/index.d.ts.map +1 -1
  19. package/dist/types/src/components/Form/SearchInput/SearchInput.types.d.ts +21 -0
  20. package/dist/types/src/components/Form/SearchInput/SearchInput.types.d.ts.map +1 -0
  21. package/dist/types/src/components/Form/SearchInput/index.d.ts +4 -25
  22. package/dist/types/src/components/Form/SearchInput/index.d.ts.map +1 -1
  23. package/dist/types/src/components/ProgressBar/ProgressBar.types.d.ts +11 -0
  24. package/dist/types/src/components/ProgressBar/ProgressBar.types.d.ts.map +1 -0
  25. package/dist/types/src/components/ProgressBar/index.d.ts +4 -15
  26. package/dist/types/src/components/ProgressBar/index.d.ts.map +1 -1
  27. package/dist/types/src/components/Tag/Tag.types.d.ts +13 -0
  28. package/dist/types/src/components/Tag/Tag.types.d.ts.map +1 -0
  29. package/dist/types/src/components/Tag/index.d.ts +3 -17
  30. package/dist/types/src/components/Tag/index.d.ts.map +1 -1
  31. package/dist/types/src/stories/Alert.stories.d.ts +40 -91
  32. package/dist/types/src/stories/Alert.stories.d.ts.map +1 -1
  33. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ export type TagProps = {
2
+ /** The text content of the tag */
3
+ text: string;
4
+ /** The variant of the tag. Is ignored if you add a custom modifier. */
5
+ variant?: 'default' | 'information' | 'success' | 'warning' | 'error';
6
+ /** The secondary (inverted) look of all variants. */
7
+ secondary?: boolean;
8
+ /** A list of available icon names can be found here. Write names as snake case (so "Check Circle" becomes check_circle). */
9
+ icon?: string;
10
+ /** The position of the icon */
11
+ iconPosition?: 'left' | 'right';
12
+ };
13
+ //# sourceMappingURL=Tag.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tag/Tag.types.ts"],"names":[],"mappings":"AAAE,MAAM,MAAM,QAAQ,GAAG;IACrB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,uEAAuE;IACvE,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAA;IACrE,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4HAA4H;IAC5H,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC,CAAA"}
@@ -1,19 +1,5 @@
1
- export function Tag({ text, variant, secondary, icon, iconPosition }: {
2
- text: any;
3
- variant: any;
4
- secondary: any;
5
- icon: any;
6
- iconPosition: any;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- export namespace Tag {
9
- namespace propTypes {
10
- let text: PropTypes.Validator<string>;
11
- let variant: PropTypes.Requireable<string>;
12
- let secondary: PropTypes.Requireable<boolean>;
13
- let icon: PropTypes.Requireable<string>;
14
- let iconPosition: PropTypes.Requireable<string>;
15
- }
16
- }
1
+ import "./Tag.scss";
2
+ import type { TagProps } from "./Tag.types";
3
+ export declare const Tag: ({ text, variant, secondary, icon, iconPosition, }: TagProps) => import("react/jsx-runtime").JSX.Element;
17
4
  export default Tag;
18
- import PropTypes from "prop-types";
19
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tag/index.jsx"],"names":[],"mappings":"AAKO;;;;;;4CA4BN;;;;;;;;;;;sBAjCqB,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tag/index.tsx"],"names":[],"mappings":"AAEA,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,eAAO,MAAM,GAAG,GAAI,mDAMjB,QAAQ,4CAwBV,CAAC;AAEF,eAAe,GAAG,CAAC"}
@@ -1,92 +1,41 @@
1
- export default options;
2
- export namespace Default {
3
- let args: {};
4
- }
5
- export namespace Error {
6
- export namespace args_1 {
7
- let type: string;
8
- let children: import("react/jsx-runtime").JSX.Element;
9
- }
10
- export { args_1 as args };
11
- }
12
- export namespace Warning {
13
- export namespace args_2 {
14
- let type_1: string;
15
- export { type_1 as type };
16
- }
17
- export { args_2 as args };
18
- }
19
- export namespace Success {
20
- export namespace args_3 {
21
- let type_2: string;
22
- export { type_2 as type };
23
- }
24
- export { args_3 as args };
25
- }
26
- export namespace WithActions {
27
- export namespace args_4 {
28
- let type_3: string;
29
- export { type_3 as type };
30
- export let actions: ({
31
- label: string;
32
- onClick: () => void;
33
- href?: undefined;
34
- } | {
35
- href: string;
36
- label: string;
37
- onClick?: undefined;
38
- })[];
39
- }
40
- export { args_4 as args };
41
- export let decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
42
- }
43
- export namespace WithClose {
44
- export namespace args_5 {
45
- let type_4: string;
46
- export { type_4 as type };
47
- export function onClose(): void;
48
- }
49
- export { args_5 as args };
50
- }
51
- export namespace WithCustomTitle {
52
- export namespace args_6 {
53
- export let titleChildren: import("react/jsx-runtime").JSX.Element;
54
- export let text: string;
55
- let type_5: string;
56
- export { type_5 as type };
57
- }
58
- export { args_6 as args };
59
- }
60
- declare namespace options {
61
- export let title: string;
62
- export { Alert as component };
63
- export let tags: string[];
64
- let type_6: string;
65
- export { type_6 as type };
66
- export namespace argTypes {
67
- export namespace type_7 {
68
- namespace control {
69
- let type_8: string;
70
- export { type_8 as type };
71
- }
72
- let options: string[];
73
- }
74
- export { type_7 as type };
75
- export namespace onClose_1 {
76
- let description: string;
77
- }
78
- export { onClose_1 as onClose };
79
- }
80
- export namespace args_7 {
81
- let title_1: string;
82
- export { title_1 as title };
83
- let type_9: string;
84
- export { type_9 as type };
85
- let text_1: string;
86
- export { text_1 as text };
87
- let onClose_2: null;
88
- export { onClose_2 as onClose };
89
- }
90
- export { args_7 as args };
91
- }
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Alert } from "../components/Alert";
3
+ /**
4
+ * Alerts are used to call out important information.
5
+ *
6
+ * Simplest use: `<Alert title="" text="" type=""/>`
7
+ *
8
+ * For each story, click "Show code" to see the code featuring all available props defined.
9
+ *
10
+ * ### Alert types
11
+ * There are three main types:
12
+ * * error
13
+ * * warning
14
+ * * information
15
+ * * success
16
+ *
17
+ * Use the `type` prop: `<Alert type="error" .../>`
18
+ *
19
+ * ### Title/text or children
20
+ * You may provide plain text to title/text or custom children, `titleChildren` prop for title and `children` prop for text. Do not provide both plain text and children to title/text.
21
+ *
22
+ * ### Actions
23
+ * An array of actions can be provided, these will show clickable links.
24
+ *
25
+ * e.g. `<Alert ... actions={[ {href: '', label: ''} ]}/>`
26
+ *
27
+ */
28
+ declare const meta: Meta<typeof Alert>;
29
+ export default meta;
30
+ type Story = StoryObj<typeof Alert>;
31
+ /**
32
+ * Primary buttons are used to denote the main action that the user should take next.
33
+ */
34
+ export declare const Default: Story;
35
+ export declare const Error: Story;
36
+ export declare const Warning: Story;
37
+ export declare const Success: Story;
38
+ export declare const WithActions: Story;
39
+ export declare const WithClose: Story;
40
+ export declare const WithCustomTitle: Story;
92
41
  //# sourceMappingURL=Alert.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Alert.stories.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqHa,gCAER"}
1
+ {"version":3,"file":"Alert.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/Alert.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAqB5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAYnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raspberrypifoundation/design-system-react",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "type": "module",
5
5
  "main": "./dist/design-system-react.umd.cjs",
6
6
  "module": "./dist/design-system-react.js",