@marigold/system 0.0.2 → 0.3.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 (47) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/dist/Box.d.ts +14 -0
  3. package/dist/Global.d.ts +2 -0
  4. package/dist/SVG.d.ts +6 -0
  5. package/dist/index.d.ts +7 -4
  6. package/dist/normalize.d.ts +143 -5
  7. package/dist/system.cjs.development.js +334 -159
  8. package/dist/system.cjs.development.js.map +1 -1
  9. package/dist/system.cjs.production.min.js +1 -1
  10. package/dist/system.cjs.production.min.js.map +1 -1
  11. package/dist/system.esm.js +324 -156
  12. package/dist/system.esm.js.map +1 -1
  13. package/dist/theme.d.ts +136 -0
  14. package/dist/types.d.ts +8 -0
  15. package/dist/useTheme.d.ts +15 -5
  16. package/dist/variant.d.ts +29 -0
  17. package/package.json +6 -8
  18. package/src/Box.test.tsx +308 -0
  19. package/src/Box.tsx +199 -0
  20. package/src/Colors.stories.mdx +492 -448
  21. package/src/Global.test.tsx +57 -0
  22. package/src/Global.tsx +34 -0
  23. package/src/SVG.stories.mdx +55 -0
  24. package/src/SVG.test.tsx +82 -0
  25. package/src/SVG.tsx +24 -0
  26. package/src/concepts-principles.mdx +1 -1
  27. package/src/index.ts +7 -4
  28. package/src/normalize.test.tsx +15 -0
  29. package/src/normalize.ts +79 -93
  30. package/src/theme.ts +157 -0
  31. package/src/types.ts +14 -0
  32. package/src/useTheme.test.tsx +92 -17
  33. package/src/useTheme.tsx +45 -6
  34. package/src/variant.test.ts +93 -0
  35. package/src/variant.ts +54 -0
  36. package/dist/categories.d.ts +0 -169
  37. package/dist/system.d.ts +0 -37
  38. package/dist/useClassname.d.ts +0 -2
  39. package/dist/useStyles.d.ts +0 -10
  40. package/src/categories.ts +0 -203
  41. package/src/system.test.tsx +0 -84
  42. package/src/system.tsx +0 -55
  43. package/src/useClassname.test.tsx +0 -61
  44. package/src/useClassname.ts +0 -8
  45. package/src/useStyles.test.tsx +0 -313
  46. package/src/useStyles.ts +0 -56
  47. package/src/writeComponent.stories.mdx +0 -126
package/CHANGELOG.md ADDED
@@ -0,0 +1,95 @@
1
+ # @marigold/system
2
+
3
+ ## 0.3.0
4
+ ### Minor Changes
5
+
6
+
7
+
8
+ - [#1163](https://github.com/marigold-ui/marigold/pull/1163) [`51af6693`](https://github.com/marigold-ui/marigold/commit/51af669330fd52e4e31fe5ad71d2b202ab8d2231) Thanks [@sebald](https://github.com/sebald)! - feat(system): Expose helper to transpile style object
9
+
10
+
11
+ ### Patch Changes
12
+
13
+
14
+
15
+ - [#1549](https://github.com/marigold-ui/marigold/pull/1549) [`c030aa85`](https://github.com/marigold-ui/marigold/commit/c030aa85156356c294bafe9831024f6b6f2ce4db) Thanks [@sebald](https://github.com/sebald)! - refa: use emotion's theme function in <Element>
16
+
17
+
18
+
19
+ - [#1515](https://github.com/marigold-ui/marigold/pull/1515) [`8eda245f`](https://github.com/marigold-ui/marigold/commit/8eda245f01a918fcdaa9f0ac211889ed869aa375) Thanks [@sebald](https://github.com/sebald)! - feat: add normalization for body and html & fix emotion leak
20
+
21
+
22
+
23
+ - [#1491](https://github.com/marigold-ui/marigold/pull/1491) [`5a04de11`](https://github.com/marigold-ui/marigold/commit/5a04de110637d004f5824679697ee4d6a90eaf34) Thanks [@ti10le](https://github.com/ti10le)! - remove useStyles from Element
24
+
25
+
26
+
27
+ - [#1440](https://github.com/marigold-ui/marigold/pull/1440) [`c1da52c0`](https://github.com/marigold-ui/marigold/commit/c1da52c0f035b141608fd606e6ba3bc2b5482dc1) Thanks [@ti10le](https://github.com/ti10le)! - feature: use Element in Box + necessary fix changes
28
+
29
+
30
+
31
+ - [#1591](https://github.com/marigold-ui/marigold/pull/1591) [`1448ddca`](https://github.com/marigold-ui/marigold/commit/1448ddcaa0f647f48b018fa74a8686af30eccc53) Thanks [@sebald](https://github.com/sebald)! - feat(jest): Improve snapshot readability
32
+
33
+
34
+
35
+ - [#1514](https://github.com/marigold-ui/marigold/pull/1514) [`5107b943`](https://github.com/marigold-ui/marigold/commit/5107b943cb3085eb3137d84e79966acad6173a26) Thanks [@sebald](https://github.com/sebald)! - feat(system): Use emotion's context
36
+
37
+
38
+
39
+ - [#1647](https://github.com/marigold-ui/marigold/pull/1647) [`cd3a0d3e`](https://github.com/marigold-ui/marigold/commit/cd3a0d3edb3f2ddc1f561e8007e1c20000f7855a) Thanks [@ti10le](https://github.com/ti10le)! - feat: conditional function to allow state props in variants
40
+
41
+
42
+
43
+ - [#1230](https://github.com/marigold-ui/marigold/pull/1230) [`ebd6e26f`](https://github.com/marigold-ui/marigold/commit/ebd6e26f71f675b98b663bc45c6a2d5badddcd47) Thanks [@viktoria-schwarz](https://github.com/viktoria-schwarz)! - feat: add GlobalStyles via theme
44
+
45
+
46
+
47
+ - [#1563](https://github.com/marigold-ui/marigold/pull/1563) [`6e485f5a`](https://github.com/marigold-ui/marigold/commit/6e485f5a8800094fe54c075a2b21f8abe726b3cd) Thanks [@sebald](https://github.com/sebald)! - feat: Introduce a `Theme` with all available scales
48
+
49
+
50
+
51
+ - [#1620](https://github.com/marigold-ui/marigold/pull/1620) [`80a2abe5`](https://github.com/marigold-ui/marigold/commit/80a2abe5804ba2c5a48cc6b05211245c37baf266) Thanks [@ti10le](https://github.com/ti10le)! - feat(comp): extend Box to handle __default variants
52
+
53
+
54
+
55
+ - [#1579](https://github.com/marigold-ui/marigold/pull/1579) [`e13e3cc1`](https://github.com/marigold-ui/marigold/commit/e13e3cc1fc66b261209973b1fc90eb48117076e9) Thanks [@ti10le](https://github.com/ti10le)! - feat: remove Heading from marigold
56
+
57
+
58
+
59
+ - [#1622](https://github.com/marigold-ui/marigold/pull/1622) [`1829cf17`](https://github.com/marigold-ui/marigold/commit/1829cf17e16c574e5577b3e1709c34dc7ed4faaf) Thanks [@ti10le](https://github.com/ti10le)! - feat(comp): change Card default variant
60
+
61
+
62
+
63
+ - [#1501](https://github.com/marigold-ui/marigold/pull/1501) [`1c1f8648`](https://github.com/marigold-ui/marigold/commit/1c1f864820a060214406ef711f4ed873746c16c4) Thanks [@ti10le](https://github.com/ti10le)! - feat(storybook): remove use styles stories
64
+
65
+
66
+
67
+ - [#1190](https://github.com/marigold-ui/marigold/pull/1190) [`a00b7eb9`](https://github.com/marigold-ui/marigold/commit/a00b7eb971131634414d3912d059fb505bb7a370) Thanks [@sebald](https://github.com/sebald)! - fix(system): List reset should not remove the enumeration
68
+
69
+
70
+
71
+ - [#1499](https://github.com/marigold-ui/marigold/pull/1499) [`ec5baf85`](https://github.com/marigold-ui/marigold/commit/ec5baf85a9a0f82a4fca5bbd1e1680316c186593) Thanks [@sebald](https://github.com/sebald)! - feat: Update and simplify normalization
72
+
73
+
74
+
75
+ - [#1652](https://github.com/marigold-ui/marigold/pull/1652) [`0bb8f19e`](https://github.com/marigold-ui/marigold/commit/0bb8f19ebdec0e2f9dc3f6164f4373cac5c10880) Thanks [@sebald](https://github.com/sebald)! - refa(system): Groupt variant related fns in own file
76
+
77
+
78
+
79
+ - [#1436](https://github.com/marigold-ui/marigold/pull/1436) [`c4ae5c5c`](https://github.com/marigold-ui/marigold/commit/c4ae5c5ca442f93034ff8f4c70adc295547951d4) Thanks [@ti10le](https://github.com/ti10le)! - create Element component + normalize file
80
+
81
+
82
+
83
+ - [#1508](https://github.com/marigold-ui/marigold/pull/1508) [`a1ef2108`](https://github.com/marigold-ui/marigold/commit/a1ef2108dd6c8e6838b517dd58c82d38e71dae2b) Thanks [@sebald](https://github.com/sebald)! - feat: Add default styling to `<Element>`
84
+
85
+
86
+
87
+ - [#1621](https://github.com/marigold-ui/marigold/pull/1621) [`2f7b936f`](https://github.com/marigold-ui/marigold/commit/2f7b936f5b07eade00a51cb138c3c492f1e08c9d) Thanks [@ti10le](https://github.com/ti10le)! - feat(comp): change Badge default variant
88
+
89
+
90
+
91
+ - [#1550](https://github.com/marigold-ui/marigold/pull/1550) [`846eb640`](https://github.com/marigold-ui/marigold/commit/846eb640ad035c7f3410b4a8a451f8de56e62339) Thanks [@sebald](https://github.com/sebald)! - feat: Merge <Box> and <Element>
92
+
93
+
94
+
95
+ - [#1614](https://github.com/marigold-ui/marigold/pull/1614) [`5d63cd9c`](https://github.com/marigold-ui/marigold/commit/5d63cd9c14578787083c82c85d93bbd2ff0efac6) Thanks [@ti10le](https://github.com/ti10le)! - remove all purple color things
package/dist/Box.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { PolymorphicPropsWithRef, PolymorphicComponentWithRef } from '@marigold/types';
2
+ import { CSSObject } from './types';
3
+ export declare type StyleProps = Pick<CSSObject, 'display' | 'height' | 'width' | 'minWidth' | 'maxWidth' | 'position' | 'top' | 'bottom' | 'right' | 'left' | 'zIndex' | 'p' | 'px' | 'py' | 'pt' | 'pb' | 'pl' | 'pr' | 'm' | 'mx' | 'my' | 'mt' | 'mb' | 'ml' | 'mr' | 'flexDirection' | 'flexWrap' | 'flexShrink' | 'flexGrow' | 'alignItems' | 'justifyContent' | 'bg' | 'border' | 'borderRadius' | 'boxShadow' | 'opacity' | 'overflow' | 'transition'>;
4
+ export declare type BoxOwnProps = {
5
+ css?: CSSObject;
6
+ variant?: string | string[];
7
+ /**
8
+ * Use to set base styles for the component
9
+ * @internal Used to set default styles for Marigold components
10
+ */
11
+ __baseCSS?: CSSObject;
12
+ } & StyleProps;
13
+ export declare type BoxProps = PolymorphicPropsWithRef<BoxOwnProps, 'div'>;
14
+ export declare const Box: PolymorphicComponentWithRef<BoxOwnProps, 'div'>;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const Global: () => JSX.Element;
package/dist/SVG.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ComponentProps } from '@marigold/types';
3
+ export declare type SVGProps = {
4
+ size?: number;
5
+ } & ComponentProps<'svg'>;
6
+ export declare const SVG: React.FC<SVGProps>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- export * from './categories';
2
- export * from './system';
3
- export * from './useClassname';
4
- export * from './useStyles';
1
+ export * from './Box';
2
+ export * from './Global';
3
+ export * from './normalize';
4
+ export * from './SVG';
5
+ export * from './theme';
6
+ export * from './types';
5
7
  export * from './useTheme';
8
+ export * from './variant';
@@ -1,6 +1,144 @@
1
- import { CSSObject } from '@marigold/components/src';
2
- export declare const el: BaseNormalization;
3
- declare type BaseNormalization = {
4
- [key: string]: CSSObject;
1
+ /// <reference types="react" />
2
+ export declare const normalize: {
3
+ readonly base: {
4
+ readonly boxSizing: "border-box";
5
+ readonly margin: 0;
6
+ readonly minWidth: 0;
7
+ };
8
+ readonly a: {
9
+ readonly textDecoration: "none";
10
+ readonly boxSizing: "border-box";
11
+ readonly margin: 0;
12
+ readonly minWidth: 0;
13
+ };
14
+ readonly p: {
15
+ readonly overflowWrap: "break-word";
16
+ readonly boxSizing: "border-box";
17
+ readonly margin: 0;
18
+ readonly minWidth: 0;
19
+ };
20
+ readonly h1: {
21
+ readonly overflowWrap: "break-word";
22
+ readonly boxSizing: "border-box";
23
+ readonly margin: 0;
24
+ readonly minWidth: 0;
25
+ };
26
+ readonly h2: {
27
+ readonly overflowWrap: "break-word";
28
+ readonly boxSizing: "border-box";
29
+ readonly margin: 0;
30
+ readonly minWidth: 0;
31
+ };
32
+ readonly h3: {
33
+ readonly overflowWrap: "break-word";
34
+ readonly boxSizing: "border-box";
35
+ readonly margin: 0;
36
+ readonly minWidth: 0;
37
+ };
38
+ readonly h4: {
39
+ readonly overflowWrap: "break-word";
40
+ readonly boxSizing: "border-box";
41
+ readonly margin: 0;
42
+ readonly minWidth: 0;
43
+ };
44
+ readonly h5: {
45
+ readonly overflowWrap: "break-word";
46
+ readonly boxSizing: "border-box";
47
+ readonly margin: 0;
48
+ readonly minWidth: 0;
49
+ };
50
+ readonly h6: {
51
+ readonly overflowWrap: "break-word";
52
+ readonly boxSizing: "border-box";
53
+ readonly margin: 0;
54
+ readonly minWidth: 0;
55
+ };
56
+ readonly img: {
57
+ readonly display: "block";
58
+ readonly maxWidth: "100%";
59
+ readonly boxSizing: "border-box";
60
+ readonly margin: 0;
61
+ readonly minWidth: 0;
62
+ };
63
+ readonly picture: {
64
+ readonly display: "block";
65
+ readonly maxWidth: "100%";
66
+ readonly boxSizing: "border-box";
67
+ readonly margin: 0;
68
+ readonly minWidth: 0;
69
+ };
70
+ readonly video: {
71
+ readonly display: "block";
72
+ readonly maxWidth: "100%";
73
+ readonly boxSizing: "border-box";
74
+ readonly margin: 0;
75
+ readonly minWidth: 0;
76
+ };
77
+ readonly canvas: {
78
+ readonly display: "block";
79
+ readonly maxWidth: "100%";
80
+ readonly boxSizing: "border-box";
81
+ readonly margin: 0;
82
+ readonly minWidth: 0;
83
+ };
84
+ readonly svg: {
85
+ readonly display: "block";
86
+ readonly maxWidth: "100%";
87
+ readonly boxSizing: "border-box";
88
+ readonly margin: 0;
89
+ readonly minWidth: 0;
90
+ };
91
+ readonly select: {
92
+ readonly display: "block";
93
+ readonly appearance: "none";
94
+ readonly font: "inherit";
95
+ readonly '&::-ms-expand': {
96
+ readonly display: "none";
97
+ };
98
+ readonly boxSizing: "border-box";
99
+ readonly margin: 0;
100
+ readonly minWidth: 0;
101
+ };
102
+ readonly button: {
103
+ readonly display: "block";
104
+ readonly appearance: "none";
105
+ readonly font: "inherit";
106
+ readonly background: "transparent";
107
+ readonly textAlign: "center";
108
+ readonly boxSizing: "border-box";
109
+ readonly margin: 0;
110
+ readonly minWidth: 0;
111
+ };
112
+ readonly textarea: {
113
+ readonly display: "block";
114
+ readonly appearance: "none";
115
+ readonly font: "inherit";
116
+ readonly boxSizing: "border-box";
117
+ readonly margin: 0;
118
+ readonly minWidth: 0;
119
+ };
120
+ readonly input: {
121
+ readonly display: "block";
122
+ readonly appearance: "none";
123
+ readonly font: "inherit";
124
+ readonly '&::-ms-clear': {
125
+ readonly display: "none";
126
+ };
127
+ readonly '&::-webkit-search-cancel-button': {
128
+ readonly WebkitAppearance: "none";
129
+ };
130
+ readonly boxSizing: "border-box";
131
+ readonly margin: 0;
132
+ readonly minWidth: 0;
133
+ };
134
+ };
135
+ export declare type NormalizedElement = keyof typeof normalize;
136
+ /**
137
+ * Type-safe helper to get normalization. If no normalization is found,
138
+ * returns the *base* normalization.
139
+ */
140
+ export declare const getNormalizedStyles: (val?: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined) => {
141
+ readonly boxSizing: "border-box";
142
+ readonly margin: 0;
143
+ readonly minWidth: 0;
5
144
  };
6
- export {};