@telia/teddy 0.0.3 → 0.0.4

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 (108) hide show
  1. package/README.md +8 -10
  2. package/dist/assets/5161b177f001ea1a.svg +1080 -0
  3. package/dist/assets/badge.css +1 -0
  4. package/dist/assets/button.css +1 -1
  5. package/dist/assets/grid.css +1 -0
  6. package/dist/assets/heading.css +1 -0
  7. package/dist/assets/icon.css +1 -1
  8. package/dist/assets/input.css +1 -1
  9. package/dist/assets/label.css +1 -1
  10. package/dist/assets/link.css +1 -0
  11. package/dist/assets/main.css +1 -1
  12. package/dist/assets/navigation-menu.css +1 -0
  13. package/dist/assets/text-field.css +1 -1
  14. package/dist/assets/text-spacing.css +1 -0
  15. package/dist/assets/text.css +1 -1
  16. package/dist/assets/visually-hidden.css +1 -0
  17. package/dist/badge-CbHdlkcM.js +742 -0
  18. package/dist/components/accordion/accordion.d.ts +59 -0
  19. package/dist/components/accordion/accordion.js +24 -0
  20. package/dist/components/accordion/index.d.ts +2 -0
  21. package/dist/components/accordion/index.js +4 -0
  22. package/dist/components/badge/badge.d.ts +21 -0
  23. package/dist/components/badge/badge.js +24 -0
  24. package/dist/components/badge/index.d.ts +2 -0
  25. package/dist/components/badge/index.js +4 -0
  26. package/dist/components/button/button.d.ts +19 -20
  27. package/dist/components/button/button.js +82 -71
  28. package/dist/components/button/index.d.ts +1 -1
  29. package/dist/components/card/card.d.ts +68 -0
  30. package/dist/components/card/card.js +24 -0
  31. package/dist/components/card/index.d.ts +2 -0
  32. package/dist/components/card/index.js +4 -0
  33. package/dist/components/field-error-text/field-error-text.d.ts +4 -3
  34. package/dist/components/field-error-text/field-error-text.js +12 -12
  35. package/dist/components/grid/grid.d.ts +77 -0
  36. package/dist/components/grid/grid.js +393 -0
  37. package/dist/components/grid/index.d.ts +2 -0
  38. package/dist/components/grid/index.js +4 -0
  39. package/dist/components/heading/heading.d.ts +63 -0
  40. package/dist/components/heading/heading.js +53 -0
  41. package/dist/components/heading/index.d.ts +2 -0
  42. package/dist/components/heading/index.js +4 -0
  43. package/dist/components/helper-text/helper-text.d.ts +2 -1
  44. package/dist/components/helper-text/helper-text.js +7 -7
  45. package/dist/components/icon/icon.d.ts +13 -2
  46. package/dist/components/icon/icon.js +22 -22
  47. package/dist/components/icon/index.d.ts +2 -1
  48. package/dist/components/icon/index.js +1 -1
  49. package/dist/components/index.d.ts +10 -0
  50. package/dist/components/index.js +38 -21
  51. package/dist/components/input/input.d.ts +14 -23
  52. package/dist/components/input/input.js +72 -50
  53. package/dist/components/label/label.d.ts +3 -1
  54. package/dist/components/label/label.js +23 -51
  55. package/dist/components/link/index.d.ts +2 -0
  56. package/dist/components/link/index.js +4 -0
  57. package/dist/components/link/link.d.ts +49 -0
  58. package/dist/components/link/link.js +36 -0
  59. package/dist/components/navigation-menu/index.d.ts +2 -0
  60. package/dist/components/navigation-menu/index.js +4 -0
  61. package/dist/components/navigation-menu/navigation-menu.d.ts +126 -0
  62. package/dist/components/navigation-menu/navigation-menu.js +10 -0
  63. package/dist/components/spinner/spinner.d.ts +2 -1
  64. package/dist/components/spinner/spinner.js +5 -5
  65. package/dist/components/switch/index.d.ts +2 -0
  66. package/dist/components/switch/index.js +4 -0
  67. package/dist/components/switch/switch.d.ts +44 -0
  68. package/dist/components/switch/switch.js +23 -0
  69. package/dist/components/text/text.d.ts +15 -8
  70. package/dist/components/text/text.js +27 -41
  71. package/dist/components/text-field/text-field.d.ts +24 -24
  72. package/dist/components/text-field/text-field.js +102 -125
  73. package/dist/components/text-spacing/index.d.ts +2 -0
  74. package/dist/components/text-spacing/index.js +4 -0
  75. package/dist/components/text-spacing/text-spacing.d.ts +19 -0
  76. package/dist/components/text-spacing/text-spacing.js +17 -0
  77. package/dist/components/visually-hidden/index.d.ts +2 -0
  78. package/dist/components/visually-hidden/index.js +4 -0
  79. package/dist/components/visually-hidden/visually-hidden.d.ts +15 -0
  80. package/dist/components/visually-hidden/visually-hidden.js +24 -0
  81. package/dist/icons/category.d.ts +985 -0
  82. package/dist/icons/category.js +333 -0
  83. package/dist/icons/name.d.ts +1 -1
  84. package/dist/icons/name.js +250 -200
  85. package/dist/index-DM5e-Whg.js +43 -0
  86. package/dist/index-DpfSJps6.js +75 -0
  87. package/dist/main.d.ts +1 -0
  88. package/dist/main.js +53 -36
  89. package/dist/navigation-menu-BgN7IKev.js +1334 -0
  90. package/dist/tokens/spacing/variables.json.d.ts +34 -0
  91. package/dist/utils/action.d.ts +1 -1
  92. package/dist/utils/composeEventHandlers.d.ts +30 -0
  93. package/dist/utils/composeEventHandlers.js +9 -0
  94. package/dist/utils/composeRefs.d.ts +40 -0
  95. package/dist/utils/composeRefs.js +14 -0
  96. package/dist/utils/layout.d.ts +12 -0
  97. package/dist/utils/layout.js +11 -0
  98. package/package.json +23 -22
  99. package/dist/assets/f2a2f391a886d395.svg +0 -284
  100. package/dist/index-TI1xsy6a.js +0 -70
  101. package/dist/teams/index.d.ts +0 -0
  102. package/dist/teams/index.js +0 -1
  103. package/dist/teams/min-side/index.d.ts +0 -0
  104. package/dist/teams/min-side/index.js +0 -1
  105. package/dist/teams/webshop/index.d.ts +0 -0
  106. package/dist/teams/webshop/index.js +0 -1
  107. /package/dist/{teams/business/index.d.ts → components/text-field/tex-field-label.d.ts} +0 -0
  108. /package/dist/{teams/business/index.js → components/text-field/tex-field-label.js} +0 -0
@@ -0,0 +1,34 @@
1
+ declare const _default: {
2
+ "spacing": {
3
+ "0": "0rem",
4
+ "10": "0.0625rem",
5
+ "25": "0.125rem",
6
+ "50": "0.25rem",
7
+ "100": "0.5rem",
8
+ "150": "0.75rem",
9
+ "200": "1rem",
10
+ "250": "1.25rem",
11
+ "300": "1.5rem",
12
+ "400": "2rem",
13
+ "600": "3rem",
14
+ "800": "4rem",
15
+ "1000": "5rem",
16
+ "1200": "6rem",
17
+ "1600": "8rem",
18
+ "gutter": {
19
+ "sm": "1rem",
20
+ "md": "1.5rem",
21
+ "lg": "1.5rem",
22
+ "xl": "1.5rem"
23
+ },
24
+ "page-padding": {
25
+ "sm": "1rem",
26
+ "md": "1.5rem",
27
+ "lg": "3rem",
28
+ "xl": "3rem"
29
+ }
30
+ }
31
+ }
32
+ ;
33
+
34
+ export default _default;
@@ -7,7 +7,7 @@ export declare const VARIANT: {
7
7
  readonly EXPRESSIVE: "expressive";
8
8
  readonly EXPRESSIVE_NEGATIVE: "expressive-negative";
9
9
  };
10
- export declare const variants: ("primary" | "primary-negative" | "secondary" | "secondary-negative" | "expressive" | "expressive-negative")[];
10
+ export declare const variants: ("primary" | "secondary" | "expressive" | "primary-negative" | "secondary-negative" | "expressive-negative")[];
11
11
  export type Variant = (typeof VARIANT)[keyof typeof VARIANT];
12
12
  export declare const SIZE: {
13
13
  readonly SM: "sm";
@@ -0,0 +1,30 @@
1
+ /**
2
+ This utilities is a copy from Radix UI.
3
+
4
+
5
+ MIT License
6
+
7
+ Copyright (c) 2022 WorkOS
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+ */
27
+ declare function composeEventHandlers<E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
28
+ checkForDefaultPrevented?: boolean | undefined;
29
+ }): (event: E) => void;
30
+ export { composeEventHandlers };
@@ -0,0 +1,9 @@
1
+ function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
2
+ return function(s) {
3
+ if (f == null || f(s), p === !1 || !s.defaultPrevented)
4
+ return c == null ? void 0 : c(s);
5
+ };
6
+ }
7
+ export {
8
+ h as composeEventHandlers
9
+ };
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+
3
+ /**
4
+ This utilities is a copy from Radix UI.
5
+
6
+
7
+ MIT License
8
+
9
+ Copyright (c) 2022 WorkOS
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ */
29
+ type PossibleRef<T> = React.Ref<T> | undefined;
30
+ /**
31
+ * A utility to compose multiple refs together
32
+ * Accepts callback refs and RefObject(s)
33
+ */
34
+ declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
35
+ /**
36
+ * A custom hook that composes multiple refs
37
+ * Accepts callback refs and RefObject(s)
38
+ */
39
+ declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
40
+ export { composeRefs, useComposedRefs };
@@ -0,0 +1,14 @@
1
+ import e from "react";
2
+ function u(o, t) {
3
+ typeof o == "function" ? o(t) : o != null && (o.current = t);
4
+ }
5
+ function c(...o) {
6
+ return (t) => o.forEach((n) => u(n, t));
7
+ }
8
+ function i(...o) {
9
+ return e.useCallback(c(...o), o);
10
+ }
11
+ export {
12
+ c as composeRefs,
13
+ i as useComposedRefs
14
+ };
@@ -0,0 +1,12 @@
1
+ import { breakpoint } from '../tokens/breakpoint/variables.json';
2
+
3
+ type Breakpoint = keyof typeof breakpoint;
4
+ export type Responsive<T> = {
5
+ [key in Breakpoint]?: T;
6
+ } | T;
7
+ export declare function extractResponsiveClassName<T>({ responsiveValue, rootClassName, styles, }: {
8
+ responsiveValue: Responsive<T>;
9
+ rootClassName: string;
10
+ styles: CSSModuleClasses;
11
+ }): string[] | string[][] | undefined;
12
+ export {};
@@ -0,0 +1,11 @@
1
+ function e({
2
+ responsiveValue: t,
3
+ rootClassName: n,
4
+ styles: r
5
+ }) {
6
+ if (t)
7
+ return typeof t == "object" && t ? Object.entries(t).map(([c, $]) => [r[`${c}:${n}-${$}`]]) : [r[`${n}-${t}`]];
8
+ }
9
+ export {
10
+ e as extractResponsiveClassName
11
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "pnpm": ">=8"
12
12
  },
13
13
  "private": false,
14
- "version": "0.0.3",
14
+ "version": "0.0.4",
15
15
  "sideEffects": [
16
16
  "**/*.css"
17
17
  ],
@@ -21,21 +21,19 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@changesets/cli": "^2.27.1",
24
- "@chromatic-com/storybook": "^1.2.1",
24
+ "@chromatic-com/storybook": "^1.3.1",
25
25
  "@laynezh/vite-plugin-lib-assets": "^0.5.19",
26
- "@storybook/addon-a11y": "^8.0.0-rc.0",
27
- "@storybook/addon-essentials": "^8.0.0-rc.0",
28
- "@storybook/addon-interactions": "^8.0.0-rc.0",
29
- "@storybook/addon-links": "^8.0.0-rc.0",
30
- "@storybook/addon-mdx-gfm": "^8.0.0-rc.0",
31
- "@storybook/addon-onboarding": "^8.0.0-rc.0",
32
- "@storybook/addon-storysource": "^8.0.0-rc.0",
33
- "@storybook/blocks": "^8.0.0-rc.0",
34
- "@storybook/manager-api": "^8.0.0-rc.0",
35
- "@storybook/react": "^8.0.0-rc.0",
36
- "@storybook/react-vite": "^8.0.0-rc.0",
37
- "@storybook/test": "^8.0.0-rc.0",
38
- "@storybook/theming": "^8.0.0-rc.0",
26
+ "@storybook/addon-a11y": "^8.0.6",
27
+ "@storybook/addon-essentials": "^8.0.6",
28
+ "@storybook/addon-interactions": "^8.0.6",
29
+ "@storybook/addon-links": "^8.0.6",
30
+ "@storybook/addon-storysource": "^8.0.6",
31
+ "@storybook/blocks": "^8.0.6",
32
+ "@storybook/manager-api": "^8.0.6",
33
+ "@storybook/react": "^8.0.6",
34
+ "@storybook/react-vite": "^8.0.6",
35
+ "@storybook/test": "^8.0.6",
36
+ "@storybook/theming": "^8.0.6",
39
37
  "@types/fs-extra": "^11.0.4",
40
38
  "@types/node": "^20.11.16",
41
39
  "@types/react": "^18.2.53",
@@ -51,18 +49,18 @@
51
49
  "eslint-plugin-mdx": "^3.1.5",
52
50
  "eslint-plugin-react-hooks": "^4.6.0",
53
51
  "eslint-plugin-react-refresh": "^0.4.5",
54
- "eslint-plugin-storybook": "^0.6.15",
52
+ "eslint-plugin-storybook": "^0.8.0",
55
53
  "execa": "^8.0.1",
56
54
  "fs-extra": "^11.2.0",
57
55
  "glob": "^10.3.10",
58
56
  "node-html-parser": "^6.1.12",
59
- "plop": "^4.0.1",
57
+ "plop": "4.0.1",
60
58
  "prettier": "3.2.5",
61
59
  "react": "^18.2.0",
62
60
  "react-dom": "^18.2.0",
63
61
  "rollup-plugin-visualizer": "^5.12.0",
64
62
  "sass": "^1.70.0",
65
- "storybook": "^8.0.0-rc.0",
63
+ "storybook": "^8.0.6",
66
64
  "style-dictionary": "^3.9.2",
67
65
  "tsx": "^4.7.0",
68
66
  "typescript": "^5.3.3",
@@ -71,10 +69,12 @@
71
69
  "vite-plugin-lib-inject-css": "^2.0.0"
72
70
  },
73
71
  "dependencies": {
74
- "@purpurds/tokens": "^3.0.0",
75
- "@purpurds/visually-hidden": "^3.0.0",
72
+ "@radix-ui/react-accordion": "^1.1.2",
76
73
  "@radix-ui/react-label": "^2.0.2",
74
+ "@radix-ui/react-navigation-menu": "^1.1.4",
77
75
  "@radix-ui/react-slot": "^1.0.2",
76
+ "@radix-ui/react-switch": "^1.0.3",
77
+ "@react-spring/web": "^9.7.3",
78
78
  "clsx": "^2.1.0"
79
79
  },
80
80
  "description": "![Teddy - Telia Norway's Design System](/other/stories/assets/teddy200.png?raw=true)",
@@ -95,11 +95,12 @@
95
95
  "scripts": {
96
96
  "build:icons": "tsx other/scripts/build-icons.ts",
97
97
  "build:tokens": "tsx other/scripts/build-tokens.ts",
98
- "create:comp": "tsx node_modules/.bin/plop --plopfile other/scripts/plopfile.ts",
98
+ "build:storybook": "storybook build",
99
+ "build:storybook-ci": "storybook build --loglevel silly --disable-telemetry",
100
+ "create:component": "tsx node_modules/plop/bin/plop.js --plopfile other/scripts/plopfile.ts",
99
101
  "clean": "rm -rf dist",
100
102
  "prebuild": "pnpm run build:icons && pnpm run build:tokens",
101
103
  "storybook": "storybook dev -p 6006",
102
- "build-storybook": "storybook build",
103
104
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
104
105
  "preinstall": "npx only-allow pnpm",
105
106
  "dev": "vite",