@pnx-mixtape/mxds 0.0.23 → 0.0.24

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 (41) hide show
  1. package/.storybook/decorators.ts +7 -0
  2. package/.storybook/main.ts +21 -0
  3. package/.storybook/manager.ts +6 -0
  4. package/.storybook/preview.ts +60 -0
  5. package/.storybook/public/demo-logo.svg +4 -0
  6. package/.storybook/public/design-system.svg +1 -0
  7. package/.storybook/public/favicon.svg +7 -0
  8. package/.storybook/public/mixtape-logo.png +0 -0
  9. package/.storybook/public/mixtape.webp +0 -0
  10. package/.storybook/public/pinto.png +0 -0
  11. package/.storybook/public/pinto.svg +1 -0
  12. package/.storybook/public/xb.png +0 -0
  13. package/.storybook/public/xb.svg +1 -0
  14. package/.storybook/src/global.d.ts +16 -0
  15. package/.storybook/src/theme.ts +8 -0
  16. package/.storybook/storybook.css +35 -0
  17. package/.storybook/test-runner.ts +77 -0
  18. package/.storybook/theme-demo.css +89 -0
  19. package/package.json +5 -3
  20. package/src/Atom/Atom.mdx +18 -18
  21. package/src/Atom/Background/{Backgrounds.stories.ts → Background.stories.ts} +2 -1
  22. package/src/Atom/Background/__snapshots__/{Backgrounds.stories.ts.snap → Background.stories.ts.snap} +85 -25
  23. package/src/Atom/Background/_background.css +8 -10
  24. package/src/Atom/Background/backgrounds.twig +6 -4
  25. package/src/Atom/Button/Button.stories.ts +0 -1
  26. package/src/Atom/Button/_buttons-styles.css +18 -6
  27. package/src/Atom/Button/_buttons.css +1 -1
  28. package/src/Atom/Icon/_extended-set.css +0 -8
  29. package/src/Atom/Icon/_icon.css +8 -0
  30. package/src/Atom/Link/_links.css +1 -0
  31. package/src/Atom/Table/Table.stories.ts +0 -1
  32. package/src/Component/HeroSearch/HeroSearch.stories.ts +0 -2
  33. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +140 -146
  34. package/src/Component/Popover/Popover.stories.ts +45 -0
  35. package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +26 -0
  36. package/src/Component/Steps/steps.css +4 -3
  37. package/src/Form/TextInput/InputDivider.stories.ts +0 -1
  38. package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +1 -1
  39. package/src/constants.css +115 -114
  40. package/src/enums.ts +1 -0
  41. package/src/tokens.js +25 -18
package/src/constants.css CHANGED
@@ -7,122 +7,123 @@
7
7
  @property --scheme {
8
8
  syntax: "light | dark";
9
9
  inherits: true;
10
- initial-value: token("colour.scheme");
10
+ initial-value: token("colour.main.scheme");
11
11
  }
12
12
 
13
- :root {
14
- --_hue-primary: token("colour.primary");
15
- --_hue-accent: token("colour.accent");
16
- --_hue-info: token("colour.info");
17
- --_hue-error: token("colour.error");
18
- --_hue-warning: token("colour.warning");
19
- --_hue-success: token("colour.success");
20
- --_hue-outline: token("utility.outline.hue");
21
-
22
- /* Brand colors */
23
- --colour-primary: oklch(50% 0.3 var(--_hue-primary));
24
- --colour-primary-light: color-mix(in oklch, var(--colour-primary), white 90%);
25
- --colour-accent: oklch(50% 0.3 var(--_hue-accent));
26
- --colour-accent-light: color-mix(in oklch, var(--colour-accent), white 90%);
27
-
28
- /* System colours */
29
- --color-scheme: token("colour.scheme");
30
-
31
- color-scheme: var(--color-scheme);
32
-
33
- --colour-background: light-dark(token("colour.main.bg"), token("colour.reverse.bg"));
34
- --colour-background-alt: light-dark(token("colour.main.bgAlt"), token("colour.reverse.bgAlt"));
35
- --colour-foreground: light-dark(token("colour.main.fg"), token("colour.reverse.fg"));
36
- --colour-foreground-alt: light-dark(token("colour.main.fgAlt"), token("colour.reverse.fgAlt"));
37
- --colour-border: light-dark(token("colour.main.border"), token("colour.reverse.border"));
38
- --colour-link: light-dark(var(--colour-primary), var(--colour-primary-light));
39
-
40
- /* Reverse colors */
41
- --colour-foreground-reverse: light-dark(token("colour.reverse.fg"), token("colour.main.fg"));
42
- --colour-background-reverse: light-dark(token("colour.reverse.bg"), token("colour.main.bg"));
43
-
44
- /* State colours */
45
- --colour-error: oklch(45% 0.3 var(--_hue-error));
46
- --colour-success: oklch(50% 0.3 var(--_hue-success));
47
- --colour-warning: oklch(55% 0.3 var(--_hue-warning));
48
- --colour-info: oklch(50% 0.3 var(--_hue-info));
49
-
50
- /* Typography */
51
- --font-family: token("font.family");
52
- --type-ratio: token("font.size.ratio");
53
- --type-ratio-small: token("font.size.ratioSmall");
54
- --base-font-size: max(1rem, token("font.size.basePx"));
55
- --font-size: var(--base-font-size);
56
- --font-size-s: calc(var(--base-font-size) / var(--type-ratio-small));
57
- --font-size-xs: calc(var(--font-size-s) / var(--type-ratio-small));
58
- --font-size-sm: calc(var(--base-font-size) * var(--type-ratio-small));
59
- --font-size-m: calc(var(--base-font-size) * var(--type-ratio));
60
- --font-size-l: calc(var(--font-size-m) * var(--type-ratio));
61
- --font-size-xl: calc(var(--font-size-l) * var(--type-ratio));
62
- --font-size-xxl: calc(var(--font-size-xl) * var(--type-ratio));
63
- --font-size-xxxl: calc(var(--font-size-xxl) * var(--type-ratio));
64
- --font-size-diff: token("font.size.diff");
65
-
66
- --line-height: token("font.lineHeight.main");
67
- --line-height-h: token("font.lineHeight.heading");
68
- --line-height-ui: token("font.lineHeight.ui");
69
-
70
- --font-weight-normal: token("font.weight.main");
71
- --font-weight-bold: token("font.weight.bold");
72
-
73
- /* Spacing */
74
- --spacing-xxxxs: token("size.spacing.xxxxs");
75
- --spacing-xxxs: token("size.spacing.xxxs");
76
- --spacing-xxs: token("size.spacing.xxs");
77
- --spacing-xs: token("size.spacing.xs");
78
- --spacing-s: token("size.spacing.s");
79
- --spacing-m: token("size.spacing.m");
80
- --spacing-l: token("size.spacing.l");
81
- --spacing-xl: token("size.spacing.xl");
82
- --spacing-xxl: token("size.spacing.xxl");
83
- --spacing-xxxl: token("size.spacing.xxxl");
84
- --spacing-xxxxl: token("size.spacing.xxxl");
85
- --spacing-ul: token("size.spacing.ul");
86
- --spacing-uul: token("size.spacing.uul");
87
- --spacing-uuul: token("size.spacing.uuul");
88
-
89
- --outline-width: token("utility.outline.width");
90
- --outline-style: token("utility.outline.style");
91
- --_colour-outline: oklch(50% 0.3 var(--_hue-outline));
92
- --outline-color: light-dark(
93
- var(--_colour-outline),
94
- color-mix(in oklch, var(--_colour-outline), white 90%)
95
- );
96
-
97
- /* Layout */
98
- --container-max-width-narrow: token("size.container.narrow");
99
- --container-max-width: token("size.container.aligned");
100
- --gutter-min: token("size.container.gutterMin");
101
- --gutter-max: token("size.container.gutterMax");
102
- --gap-s: token("size.gap.s");
103
- --gap: token("size.gap.m");
104
- --gap-l: token("size.gap.l");
105
- --gap-xl: token("size.gap.xl");
106
- --breakpoint-xs: token("breakpoint.xs");
107
- --breakpoint-s: token("breakpoint.s");
108
- --breakpoint-m: token("breakpoint.m");
109
- --breakpoint-l: token("breakpoint.l");
110
- --breakpoint-xl: token("breakpoint.xl");
111
-
112
- /* Utility */
113
- --shadow-color: token("utility.shadow.colour");
114
- --shadow-size: token("utility.shadow.size");
115
- --shadow-shape: 0 0 var(--shadow-size);
116
- --box-shadow: var(--shadow-shape) var(--shadow-color);
117
- --border-radius: token("utility.radius.m");
118
- --border-radius-l: token("utility.radius.l");
119
- --border-radius-round: token("utility.radius.round");
120
- --ratio: token("utility.ratio");
121
- --ease: cubic-bezier(0.25, 0, 0.3, 1);
122
- }
123
-
124
- @media (--medium-down) {
13
+ @layer design-system.defaults {
125
14
  :root {
126
- --section-xl: var(--spacing-xxl);
15
+ /* Brand colors */
16
+ --colour-primary: token("colour.primary.colour");
17
+ --colour-primary-light: color-mix(in oklch, var(--colour-primary), white 90%);
18
+ --colour-primary-lighter: color-mix(in oklch, var(--colour-primary), white 20%);
19
+ --colour-primary-darker: color-mix(in oklch, var(--colour-primary), black 10%);
20
+ --colour-primary-scheme: token("colour.primary.scheme");
21
+ --colour-accent: token("colour.accent.colour");
22
+ --colour-accent-light: color-mix(in oklch, var(--colour-accent), white 90%);
23
+ --colour-accent-lighter: color-mix(in oklch, var(--colour-accent), white 20%);
24
+ --colour-accent-darker: color-mix(in oklch, var(--colour-accent), black 10%);
25
+ --colour-accent-scheme: token("colour.accent.scheme");
26
+
27
+ /* System colours */
28
+ --colour-scheme: token("colour.main.scheme");
29
+
30
+ color-scheme: var(--colour-scheme);
31
+
32
+ --colour-background: light-dark(token("colour.main.bg"), token("colour.reverse.bg"));
33
+ --colour-background-alt: light-dark(token("colour.main.bgAlt"), token("colour.reverse.bgAlt"));
34
+ --colour-foreground: light-dark(token("colour.main.fg"), token("colour.reverse.fg"));
35
+ --colour-foreground-alt: light-dark(token("colour.main.fgAlt"), token("colour.reverse.fgAlt"));
36
+ --colour-border: light-dark(token("colour.main.border"), token("colour.reverse.border"));
37
+ --colour-link: light-dark(var(--colour-primary), var(--colour-primary-light));
38
+
39
+ /* Reverse colors */
40
+ --colour-foreground-reverse: light-dark(token("colour.reverse.fg"), token("colour.main.fg"));
41
+ --colour-background-reverse: light-dark(token("colour.reverse.bg"), token("colour.main.bg"));
42
+ --colour-reverse-scheme: token("colour.reverse.scheme");
43
+
44
+ /* State colours */
45
+ --colour-error: token("colour.error");
46
+ --colour-success: token("colour.success");
47
+ --colour-warning: token("colour.warning");
48
+ --colour-info: token("colour.info");
49
+
50
+ /* Typography */
51
+ --font-family: token("font.family");
52
+ --type-ratio: token("font.size.ratio");
53
+ --type-ratio-small: token("font.size.ratioSmall");
54
+ --base-font-size: max(1rem, token("font.size.basePx"));
55
+ --font-size: var(--base-font-size);
56
+ --font-size-s: calc(var(--base-font-size) / var(--type-ratio-small));
57
+ --font-size-xs: calc(var(--font-size-s) / var(--type-ratio-small));
58
+ --font-size-sm: calc(var(--base-font-size) * var(--type-ratio-small));
59
+ --font-size-m: calc(var(--base-font-size) * var(--type-ratio));
60
+ --font-size-l: calc(var(--font-size-m) * var(--type-ratio));
61
+ --font-size-xl: calc(var(--font-size-l) * var(--type-ratio));
62
+ --font-size-xxl: calc(var(--font-size-xl) * var(--type-ratio));
63
+ --font-size-xxxl: calc(var(--font-size-xxl) * var(--type-ratio));
64
+ --font-size-diff: token("font.size.diff");
65
+
66
+ --line-height: token("font.lineHeight.main");
67
+ --line-height-h: token("font.lineHeight.heading");
68
+ --line-height-ui: token("font.lineHeight.ui");
69
+
70
+ --font-weight-normal: token("font.weight.main");
71
+ --font-weight-bold: token("font.weight.bold");
72
+
73
+ /* Spacing */
74
+ --spacing-xxxxs: token("size.spacing.xxxxs");
75
+ --spacing-xxxs: token("size.spacing.xxxs");
76
+ --spacing-xxs: token("size.spacing.xxs");
77
+ --spacing-xs: token("size.spacing.xs");
78
+ --spacing-s: token("size.spacing.s");
79
+ --spacing-m: token("size.spacing.m");
80
+ --spacing-l: token("size.spacing.l");
81
+ --spacing-xl: token("size.spacing.xl");
82
+ --spacing-xxl: token("size.spacing.xxl");
83
+ --spacing-xxxl: token("size.spacing.xxxl");
84
+ --spacing-xxxxl: token("size.spacing.xxxl");
85
+ --spacing-ul: token("size.spacing.ul");
86
+ --spacing-uul: token("size.spacing.uul");
87
+ --spacing-uuul: token("size.spacing.uuul");
88
+
89
+ --outline-width: token("utility.outline.width");
90
+ --outline-style: token("utility.outline.style");
91
+ --_colour-outline: token("utility.outline.colour");
92
+ --outline-color: light-dark(
93
+ var(--_colour-outline),
94
+ color-mix(in oklch, var(--_colour-outline), white 90%)
95
+ );
96
+
97
+ /* Layout */
98
+ --container-max-width-narrow: token("size.container.narrow");
99
+ --container-max-width: token("size.container.aligned");
100
+ --gutter-min: token("size.container.gutterMin");
101
+ --gutter-max: token("size.container.gutterMax");
102
+ --gap-s: token("size.gap.s");
103
+ --gap: token("size.gap.m");
104
+ --gap-l: token("size.gap.l");
105
+ --gap-xl: token("size.gap.xl");
106
+ --breakpoint-xs: token("breakpoint.xs");
107
+ --breakpoint-s: token("breakpoint.s");
108
+ --breakpoint-m: token("breakpoint.m");
109
+ --breakpoint-l: token("breakpoint.l");
110
+ --breakpoint-xl: token("breakpoint.xl");
111
+
112
+ /* Utility */
113
+ --shadow-color: token("utility.shadow.colour");
114
+ --shadow-size: token("utility.shadow.size");
115
+ --shadow-shape: 0 0 var(--shadow-size);
116
+ --box-shadow: var(--shadow-shape) var(--shadow-color);
117
+ --border-radius: token("utility.radius.m");
118
+ --border-radius-l: token("utility.radius.l");
119
+ --border-radius-round: token("utility.radius.round");
120
+ --ratio: token("utility.ratio");
121
+ --ease: cubic-bezier(0.25, 0, 0.3, 1);
122
+ }
123
+
124
+ @media (--medium-down) {
125
+ :root {
126
+ --section-xl: var(--spacing-xxl);
127
+ }
127
128
  }
128
129
  }
package/src/enums.ts CHANGED
@@ -146,6 +146,7 @@ export enum Icons {
146
146
  TRASH = "trash",
147
147
  USER = "user",
148
148
  SHARE = "share",
149
+ QUESTION = "question",
149
150
  }
150
151
 
151
152
  export enum GridColumns {
package/src/tokens.js CHANGED
@@ -29,27 +29,34 @@ export default {
29
29
  dropMenu: "420px",
30
30
  },
31
31
  colour: {
32
- scheme: "light",
33
- primary: "260",
34
- accent: "320",
32
+ primary: {
33
+ colour: "hsl(223 100% 50%)",
34
+ scheme: "dark",
35
+ },
36
+ accent: {
37
+ colour: "hsl(60, 94%, 68%)",
38
+ scheme: "light",
39
+ },
35
40
  main: {
36
- fg: "oklch(0 0 100)",
37
- bg: "oklch(1 0 100)",
38
- fgAlt: "oklch(0.25 0 100)",
39
- bgAlt: "oklch(0.95 0 100)",
40
- border: "oklch(.9 0 100)",
41
+ fg: "hsl(60 30% 6%)",
42
+ bg: "hsl(60 0% 100%)",
43
+ fgAlt: "hsl(60 30% 20%)",
44
+ bgAlt: "hsl(60 30% 95%)",
45
+ border: "hsl(60 5% 85%)",
46
+ scheme: "light",
41
47
  },
42
48
  reverse: {
43
- fg: "oklch(1 0 100)",
44
- bg: "oklch(0 0 100)",
45
- fgAlt: "oklch(0.95 0 100)",
46
- bgAlt: "oklch(0.25 0 100)",
47
- border: "oklch(0.25 0 100)",
49
+ fg: "hsl(60 0% 100%)",
50
+ bg: "hsl(60 30% 6%)",
51
+ fgAlt: "hsl(60 5% 60%)",
52
+ bgAlt: "hsl(60 0% 5%)",
53
+ border: "hsl(60 0% 20%)",
54
+ scheme: "dark",
48
55
  },
49
- info: "260",
50
- warning: "90",
51
- success: "140",
52
- error: "20",
56
+ info: "hsl(223 100% 50%)",
57
+ warning: "hsl(35 100% 32%)",
58
+ success: "hsl(120 100% 26%)",
59
+ error: "hsl(348 100% 33%)",
53
60
  },
54
61
  font: {
55
62
  family: "system-ui, sans-serif",
@@ -105,7 +112,7 @@ export default {
105
112
  outline: {
106
113
  width: "2px",
107
114
  style: "solid",
108
- hue: "260",
115
+ colour: "oklch(50% 0.3 260)",
109
116
  },
110
117
  radius: {
111
118
  m: "4px",