@marigold/system 0.0.3 → 0.3.1
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.
- package/CHANGELOG.md +57 -0
- package/dist/Box.d.ts +14 -0
- package/dist/Global.d.ts +2 -0
- package/dist/SVG.d.ts +6 -0
- package/dist/SVG.stories.d.ts +5 -0
- package/dist/index.d.ts +6 -3
- package/dist/normalize.d.ts +144 -0
- package/dist/system.cjs.development.js +348 -132
- package/dist/system.cjs.development.js.map +1 -1
- package/dist/system.cjs.production.min.js +1 -1
- package/dist/system.cjs.production.min.js.map +1 -1
- package/dist/system.esm.js +341 -129
- package/dist/system.esm.js.map +1 -1
- package/dist/theme.d.ts +136 -0
- package/dist/types.d.ts +2 -3
- package/dist/useTheme.d.ts +15 -5
- package/dist/variant.d.ts +29 -0
- package/package.json +4 -6
- package/src/Box.test.tsx +308 -0
- package/src/Box.tsx +199 -0
- package/src/Global.test.tsx +57 -0
- package/src/Global.tsx +34 -0
- package/src/SVG.stories.tsx +48 -0
- package/src/SVG.test.tsx +82 -0
- package/src/SVG.tsx +24 -0
- package/src/index.ts +6 -3
- package/src/normalize.test.tsx +15 -0
- package/src/normalize.ts +100 -0
- package/src/theme.ts +157 -0
- package/src/types.ts +2 -3
- package/src/useTheme.test.tsx +43 -18
- package/src/useTheme.tsx +45 -7
- package/src/variant.test.ts +93 -0
- package/src/variant.ts +54 -0
- package/dist/cache.d.ts +0 -4
- package/dist/reset.d.ts +0 -24
- package/dist/useClassname.d.ts +0 -2
- package/dist/useStyles.d.ts +0 -15
- package/src/Colors.stories.mdx +0 -455
- package/src/cache.ts +0 -4
- package/src/concepts-principles.mdx +0 -84
- package/src/reset.ts +0 -106
- package/src/useClassname.test.tsx +0 -70
- package/src/useClassname.ts +0 -24
- package/src/useStyles.test.tsx +0 -286
- package/src/useStyles.ts +0 -55
- package/src/writeComponent.stories.mdx +0 -126
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# @marigold/system
|
|
2
|
+
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1676](https://github.com/marigold-ui/marigold/pull/1676) [`379041bc`](https://github.com/marigold-ui/marigold/commit/379041bc7d4502bca98029a95afe43ce693222cd) Thanks [@ti10le](https://github.com/ti10le)! - remove the last mdx stories
|
|
8
|
+
|
|
9
|
+
## 0.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#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>
|
|
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
|
+
- [#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
|
|
22
|
+
|
|
23
|
+
* [#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
|
|
24
|
+
|
|
25
|
+
- [#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
|
|
26
|
+
|
|
27
|
+
* [#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
|
|
28
|
+
|
|
29
|
+
- [#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
|
|
30
|
+
|
|
31
|
+
* [#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
|
|
32
|
+
|
|
33
|
+
- [#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
|
|
34
|
+
|
|
35
|
+
* [#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
|
|
36
|
+
|
|
37
|
+
- [#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
|
|
38
|
+
|
|
39
|
+
* [#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
|
|
40
|
+
|
|
41
|
+
- [#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
|
|
42
|
+
|
|
43
|
+
* [#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
|
|
44
|
+
|
|
45
|
+
- [#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
|
|
46
|
+
|
|
47
|
+
* [#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
|
|
48
|
+
|
|
49
|
+
- [#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
|
|
50
|
+
|
|
51
|
+
* [#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>`
|
|
52
|
+
|
|
53
|
+
- [#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
|
|
54
|
+
|
|
55
|
+
* [#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>
|
|
56
|
+
|
|
57
|
+
- [#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'>;
|
package/dist/Global.d.ts
ADDED
package/dist/SVG.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ComponentStory } from '@storybook/react';
|
|
2
|
+
import { SVG } from './SVG';
|
|
3
|
+
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: ComponentStory<typeof SVG>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './Box';
|
|
2
|
+
export * from './Global';
|
|
3
|
+
export * from './normalize';
|
|
4
|
+
export * from './SVG';
|
|
5
|
+
export * from './theme';
|
|
2
6
|
export * from './types';
|
|
3
|
-
export * from './useClassname';
|
|
4
|
-
export * from './useStyles';
|
|
5
7
|
export * from './useTheme';
|
|
8
|
+
export * from './variant';
|
|
@@ -0,0 +1,144 @@
|
|
|
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;
|
|
144
|
+
};
|