welcome-ui 0.32.2 → 1.0.0-beta.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 (36) hide show
  1. package/dist/box.js +1 -0
  2. package/dist/box.mjs +8 -0
  3. package/dist/index.js +18 -0
  4. package/dist/index.mjs +421 -0
  5. package/dist/system.js +1 -0
  6. package/dist/system.mjs +51 -0
  7. package/dist/types/components/Box/index.d.ts +3 -0
  8. package/dist/types/components/System/index.d.ts +40 -0
  9. package/dist/types/components/WuiProvider/font.d.ts +16 -0
  10. package/dist/types/components/WuiProvider/hide-focus-rings-root.d.ts +8 -0
  11. package/dist/types/components/WuiProvider/index.d.ts +11 -0
  12. package/dist/types/components/WuiProvider/styles.d.ts +5 -0
  13. package/dist/types/components/index.d.ts +3 -0
  14. package/dist/types/index.d.ts +2 -0
  15. package/dist/types/theme/borders.d.ts +6 -0
  16. package/dist/types/theme/colors.d.ts +346 -0
  17. package/dist/types/theme/dark.d.ts +7 -0
  18. package/dist/types/theme/focus.d.ts +10 -0
  19. package/dist/types/theme/fonts.d.ts +18 -0
  20. package/dist/types/theme/index.d.ts +64 -0
  21. package/dist/types/theme/radii.d.ts +12 -0
  22. package/dist/types/theme/screens.d.ts +13 -0
  23. package/dist/types/theme/selection.d.ts +4 -0
  24. package/dist/types/theme/shadows.d.ts +5 -0
  25. package/dist/types/theme/space.d.ts +18 -0
  26. package/dist/types/theme/transitions.d.ts +13 -0
  27. package/dist/types/theme/typography.d.ts +133 -0
  28. package/dist/types/theme/underline.d.ts +9 -0
  29. package/dist/wui-provider.js +405 -0
  30. package/dist/wui-provider.mjs +459 -0
  31. package/package.json +39 -126
  32. package/CHANGELOG.md +0 -1087
  33. package/LICENSE +0 -21
  34. package/README.md +0 -63
  35. package/dist/welcome-ui.cjs.js +0 -6973
  36. package/dist/welcome-ui.es.js +0 -6914
package/dist/box.js ADDED
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),o=require("@xstyled/styled-components"),c=require("./system.js"),n=c.forwardRef((e,t)=>r.createElement(o.x.div,{ref:t,...e}));exports.Box=n;
package/dist/box.mjs ADDED
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import o from "react";
3
+ import { x as t } from "@xstyled/styled-components";
4
+ import { forwardRef as m } from "./system.mjs";
5
+ const n = m((r, e) => /* @__PURE__ */ o.createElement(t.div, { ref: e, ...r }));
6
+ export {
7
+ n as Box
8
+ };
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@xstyled/styled-components"),f=require("./box.js"),s=require("./system.js"),b=require("./wui-provider.js");function p(e,t){if(typeof e!="object"||e===null)return t;if(typeof t!="object"||t===null)return e;const o={...e};for(const l in t)t.hasOwnProperty(l)&&(o[l]=p(o[l],t[l]));return o}const x={"beige-10":"#FBF9F7","beige-20":"#F6F3EF","beige-30":"#EAE4DE","beige-40":"#D2CBC3","beige-50":"#A7A096","beige-60":"#605B55","beige-70":"#4D4944","beige-80":"#33302D","beige-90":"#1E1C1A","blue-10":"#E0F5FF","blue-20":"#BBEAFF","blue-30":"#9BDEF7","blue-40":"#55C3E9","blue-50":"#27A5D0","blue-60":"#057AA3","blue-70":"#025A79","blue-80":"#013C50","blue-90":"#00202B","green-10":"#EAFFD4","green-20":"#D6F6B4","green-30":"#BADE94","green-40":"#9FC873","green-50":"#83AD57","green-60":"#5A8034","green-70":"#40611F","green-80":"#2A4210","green-90":"#142603","neutral-10":"#FFFFFF","neutral-20":"#F3F3F3","neutral-30":"#DEDEDE","neutral-40":"#BDBDBD","neutral-50":"#989898","neutral-60":"#585858","neutral-70":"#444444","neutral-80":"#212121","neutral-90":"#000000","orange-10":"#FFEBCE","orange-20":"#FFD495","orange-30":"#FFBB59","orange-40":"#FF9F14","orange-50":"#DB860A","orange-60":"#A6670A","orange-70":"#824F06","orange-80":"#573607","orange-90":"#382303","pink-10":"#FFEAF5","pink-20":"#FFD5EB","pink-30":"#FEB7DC","pink-40":"#F696C8","pink-50":"#E468A8","pink-60":"#C24887","pink-70":"#972962","pink-80":"#6D1142","pink-90":"#3C0725","red-10":"#FBDEDC","red-20":"#FCC7C3","red-30":"#FDB3AE","red-40":"#FF9490","red-50":"#FF6165","red-60":"#E1003A","red-70":"#A80029","red-80":"#75001A","red-90":"#450101","red-orange-10":"#FFDED0","red-orange-20":"#FFC9B2","red-orange-30":"#FFB595","red-orange-40":"#FF9868","red-orange-50":"#E67B49","red-orange-60":"#C45927","red-orange-70":"#9F4217","red-orange-80":"#6D2605","red-orange-90":"#451701","teal-10":"#D5FFFA","teal-20":"#AAF4EB","teal-30":"#6DE1D2","teal-40":"#00C7AE","teal-50":"#01AA95","teal-60":"#008070","teal-70":"#00544A","teal-80":"#003D35","teal-90":"#00211D","violet-10":"#F2F2FF","violet-20":"#E0E0FF","violet-30":"#C9C9FF","violet-40":"#ACACFF","violet-50":"#9080F0","violet-60":"#7958D6","violet-70":"#593CAC","violet-80":"#422A86","violet-90":"#1F0E51","yellow-10":"#FFF8D9","yellow-20":"#FFF1B2","yellow-30":"#FFE166","yellow-40":"#FFCD00","yellow-50":"#E5B800","yellow-60":"#B69200","yellow-70":"#846A01","yellow-80":"#604D00","yellow-90":"#423500"},h=e=>({...e,"primary-10":e["yellow-10"],"primary-20":e["yellow-20"],"primary-30":e["yellow-30"],"primary-40":e["yellow-40"],"primary-50":e["yellow-50"],"primary-60":e["yellow-60"],"primary-70":e["yellow-70"],"primary-80":e["yellow-80"],"primary-90":e["yellow-90"],"secondary-blue":e["blue-40"],"secondary-green":e["green-30"],"secondary-orange":e["red-orange-40"],"secondary-pink":e["pink-40"],"secondary-teal":e["teal-40"],"secondary-violet":e["violet-40"],overlay:"rgba(0, 0, 0, 0.55)"}),g=h(x),w=Object.keys(g).reduce((e,t)=>{if(t.startsWith("secondary-")||t==="overlay")return e;const o=100-Number(t.slice(-2)),l=t.slice(0,t.length-2);return{...e,[t]:g[`${l}${o}`]}},{}),y={...g,...h(w)},A={colors:y},E=e=>({"welcome-font":[{url:`${e.fontsUrl}/welcome-font-regular`,weight:"400"},{url:`${e.fontsUrl}/welcome-font-medium`,weight:"500"},{url:`${e.fontsUrl}/welcome-font-bold`,weight:"600"},{url:`${e.fontsUrl}/welcome-font-regular-italic`,style:"italic",weight:"400"},{url:`${e.fontsUrl}/welcome-font-medium-italic`,style:"italic",weight:"500"},{url:`${e.fontsUrl}/welcome-font-bold-italic`,style:"italic",weight:"600"}],"welcome-icon-font":[{url:`${e.fontsUrl}/icon-font/__ICON_FONT_HASH__/welcome-icon-font`,display:"block"}],"work-sans":[{url:`${e.fontsUrl}/work-sans-variable`,isVariable:!0,stretch:"75% 125%",weight:"100 1000"}]}),D=(e,t)=>{const{toEm:o,toRem:l}=t,n=l;return{h0:n(65),h1:n(45),h2:n(36),h3:n(26),h4:n(20),h5:n(16),h6:n(14),lg:n(18),md:n(16),sm:n(14),"subtitle-md":n(13),"subtitle-sm":n(11),xs:n(12)}},T=({defaultLineHeight:e,toRem:t})=>({html:e,h0:t(72),h1:t(48),h2:t(40),h3:t(32),h4:t(24),h5:t(18),h6:t(16),lg:t(24),md:t(18),sm:t(18),xs:t(14),"subtitle-md":e,"subtitle-sm":e}),B={regular:400,medium:500,bold:600},v=({defaultLetterSpacing:e,toRem:t})=>({html:e,h0:t(-1.7),h1:t(-1.2),h2:t(-1),h3:t(-.9),h4:t(-.6),h5:t(-.5),h6:t(-.5),lg:e,md:e,sm:e,xs:t(-.2),"subtitle-md":t(-.2),"subtitle-sm":t(-.2)}),S=e=>{const{fontWeights:t}=e;return{h0:t.bold,h1:t.bold,h2:t.bold,h3:t.bold,h4:t.bold,h5:t.bold,h6:t.bold,lg:t.regular,md:t.regular,sm:t.regular,"subtitle-md":t.bold,"subtitle-sm":t.medium,xs:t.regular}},k=e=>{const{fonts:t}=e;return{h0:t.headings,h1:t.headings,h2:t.headings,h3:t.headings,h4:t.headings,h5:t.headings,h6:t.headings,"subtitle-md":t.headings,"subtitle-sm":t.headings}},C=()=>({"subtitle-md":"uppercase","subtitle-sm":"uppercase"}),_=e=>{const{colors:t}=e;return{h0:t["neutral-90"],h1:t["neutral-90"],h2:t["neutral-90"],h3:t["neutral-90"],h4:t["neutral-90"],h5:t["neutral-90"],h6:t["neutral-90"]}},$=e=>{const{fontSizes:t,letterSpacings:o,lineHeights:l,textsFontColors:n,textsFontFamily:F,textsFontWeights:d,textsTextTransform:m}=e;return Object.keys(t).reduce((a,r)=>({...a,[r]:{color:n[r],fontFamily:F[r]||void 0,fontWeight:d[r],fontSize:t[r],lineHeight:l[r]||l.lg,letterSpacing:o[r]||void 0,textTransform:m[r]||void 0}}),{})},U=(e,t,o)=>({texts:[e,"sans-serif"].join(", "),headings:[t,"sans-serif"].join(", "),icons:o}),c={primary:"ease",secondary:"linear",tertiary:"cubic-bezier(0.41, 0.094, 0.54, 0.07)"},W={slow:`500ms ${c.tertiary}`,medium:`300ms ${c.primary}`,fast:`100ms ${c.secondary}`},N=({colors:e})=>({default:u.css`
2
+ background-image: linear-gradient(
3
+ 0deg,
4
+ ${e["primary-40"]},
5
+ ${e["primary-40"]} 100%
6
+ );
7
+ background-repeat: no-repeat;
8
+ background-size: 100% 50%;
9
+ background-position-y: calc(200% - 2px);
10
+ transition:
11
+ background-position-y 250ms,
12
+ background-size 250ms,
13
+ color 250ms;
14
+ `,hover:u.css`
15
+ opacity: 1;
16
+ background-position-y: 100%;
17
+ background-size: 100% 100%;
18
+ `}),O=e=>({none:"0",sm:e.toRem(2),md:e.toRem(4),lg:e.toRem(8),xl:e.toRem(16),xxl:e.toRem(24),full:"100%"}),L={sm:"1px",md:"2px",lg:"3px"},P={xs:0,sm:480,md:736,lg:980,xl:1280,xxl:1440,"3xl":1620,"4xl":1920},I={sm:"1px 2px 4px 0 rgba(0,0,0,0.05)",md:"3px 4px 10px 0 rgba(0,0,0,0.07)"},z=e=>({xxs:e.toRem(2),xs:e.toRem(4),sm:e.toRem(8),md:e.toRem(12),lg:e.toRem(16),xl:e.toRem(24),xxl:e.toRem(32),"3xl":e.toRem(48),"4xl":e.toRem(64),"5xl":e.toRem(96),"6xl":e.toRem(128),"7xl":e.toRem(192)}),H=e=>({backgroundColor:e.colors["primary-40"],color:e.colors["neutral-90"]}),R=({colors:e})=>{function t(o=e["primary-40"]){return{boxShadow:`0 0 0 2px ${o}`}}return t},q="work-sans",M=16,G="-0.019rem",Y=1.15,V="https://cdn.welcome-ui.com/fonts",Z="welcome-font",J="welcome-icon-font",K=(e={})=>{const{defaultFontFamily:t=q,defaultFontSize:o=M,defaultLetterSpacing:l=G,defaultLineHeight:n=Y,fontsUrl:F=V,headingFontFamily:d=Z,iconFontFamily:m=J,...a}=e;let r={};return r.transformers={...u.rpxTransformers},r.toEm=i=>`${i/o}em`,r.toRem=i=>`${i/o}rem`,r.toPx=i=>`${i*o}px`,r.colors=g,r.fontsUrl=F,r.fontFaces=E(r),r.fontSizes=D("rem",r),r.defaultLineHeight=n,r.defaultLetterSpacing=l,r.lineHeights=T(r),r.fontWeights=B,r.letterSpacings=v(r),r.fonts=U(t,d,m),r.borderWidths=L,r.screens=P,r.space=z(r),r.inset=r.space,r.radii=O(r),r.transitions=W,r.timingFunction=c,r.shadows=I,r=p(r,a),r.selection=H(r),r.underline=N(r),r.focus=R(r),r.textsFontWeights=S(r),r.textsFontFamily=k(r),r.textsFontColors=_(r),r.textsTextTransform=C(),r.texts=$(r),r.states=u.defaultTheme.states,r=p(r,a),r};exports.Box=f.Box;exports.componentSystem=s.componentSystem;exports.filterSystemProps=s.filterSystemProps;exports.forwardRef=s.forwardRef;exports.shouldForwardProp=s.shouldForwardProp;exports.system=s.system;exports.wrapperSystem=s.wrapperSystem;exports.WuiProvider=b.WuiProvider;exports.createTheme=K;exports.darkTheme=A;
package/dist/index.mjs ADDED
@@ -0,0 +1,421 @@
1
+ "use client";
2
+ import { css as m, rpxTransformers as h, defaultTheme as f } from "@xstyled/styled-components";
3
+ import { Box as j } from "./box.mjs";
4
+ import { componentSystem as te, filterSystemProps as re, forwardRef as ne, shouldForwardProp as oe, system as le, wrapperSystem as ie } from "./system.mjs";
5
+ import { WuiProvider as ae } from "./wui-provider.mjs";
6
+ function d(e, t) {
7
+ if (typeof e != "object" || e === null) return t;
8
+ if (typeof t != "object" || t === null) return e;
9
+ const o = { ...e };
10
+ for (const l in t)
11
+ t.hasOwnProperty(l) && (o[l] = d(o[l], t[l]));
12
+ return o;
13
+ }
14
+ const x = {
15
+ "beige-10": "#FBF9F7",
16
+ "beige-20": "#F6F3EF",
17
+ "beige-30": "#EAE4DE",
18
+ "beige-40": "#D2CBC3",
19
+ "beige-50": "#A7A096",
20
+ "beige-60": "#605B55",
21
+ "beige-70": "#4D4944",
22
+ "beige-80": "#33302D",
23
+ "beige-90": "#1E1C1A",
24
+ "blue-10": "#E0F5FF",
25
+ "blue-20": "#BBEAFF",
26
+ "blue-30": "#9BDEF7",
27
+ "blue-40": "#55C3E9",
28
+ // brand
29
+ "blue-50": "#27A5D0",
30
+ "blue-60": "#057AA3",
31
+ "blue-70": "#025A79",
32
+ "blue-80": "#013C50",
33
+ "blue-90": "#00202B",
34
+ "green-10": "#EAFFD4",
35
+ "green-20": "#D6F6B4",
36
+ "green-30": "#BADE94",
37
+ // brand
38
+ "green-40": "#9FC873",
39
+ "green-50": "#83AD57",
40
+ "green-60": "#5A8034",
41
+ "green-70": "#40611F",
42
+ "green-80": "#2A4210",
43
+ "green-90": "#142603",
44
+ "neutral-10": "#FFFFFF",
45
+ "neutral-20": "#F3F3F3",
46
+ "neutral-30": "#DEDEDE",
47
+ "neutral-40": "#BDBDBD",
48
+ "neutral-50": "#989898",
49
+ "neutral-60": "#585858",
50
+ "neutral-70": "#444444",
51
+ "neutral-80": "#212121",
52
+ "neutral-90": "#000000",
53
+ "orange-10": "#FFEBCE",
54
+ "orange-20": "#FFD495",
55
+ "orange-30": "#FFBB59",
56
+ "orange-40": "#FF9F14",
57
+ "orange-50": "#DB860A",
58
+ "orange-60": "#A6670A",
59
+ "orange-70": "#824F06",
60
+ "orange-80": "#573607",
61
+ "orange-90": "#382303",
62
+ "pink-10": "#FFEAF5",
63
+ "pink-20": "#FFD5EB",
64
+ "pink-30": "#FEB7DC",
65
+ "pink-40": "#F696C8",
66
+ // brand
67
+ "pink-50": "#E468A8",
68
+ "pink-60": "#C24887",
69
+ "pink-70": "#972962",
70
+ "pink-80": "#6D1142",
71
+ "pink-90": "#3C0725",
72
+ "red-10": "#FBDEDC",
73
+ "red-20": "#FCC7C3",
74
+ "red-30": "#FDB3AE",
75
+ "red-40": "#FF9490",
76
+ "red-50": "#FF6165",
77
+ "red-60": "#E1003A",
78
+ "red-70": "#A80029",
79
+ "red-80": "#75001A",
80
+ "red-90": "#450101",
81
+ "red-orange-10": "#FFDED0",
82
+ "red-orange-20": "#FFC9B2",
83
+ "red-orange-30": "#FFB595",
84
+ "red-orange-40": "#FF9868",
85
+ // brand
86
+ "red-orange-50": "#E67B49",
87
+ "red-orange-60": "#C45927",
88
+ "red-orange-70": "#9F4217",
89
+ "red-orange-80": "#6D2605",
90
+ "red-orange-90": "#451701",
91
+ "teal-10": "#D5FFFA",
92
+ "teal-20": "#AAF4EB",
93
+ "teal-30": "#6DE1D2",
94
+ "teal-40": "#00C7AE",
95
+ // brand
96
+ "teal-50": "#01AA95",
97
+ "teal-60": "#008070",
98
+ "teal-70": "#00544A",
99
+ "teal-80": "#003D35",
100
+ "teal-90": "#00211D",
101
+ "violet-10": "#F2F2FF",
102
+ "violet-20": "#E0E0FF",
103
+ "violet-30": "#C9C9FF",
104
+ "violet-40": "#ACACFF",
105
+ // brand
106
+ "violet-50": "#9080F0",
107
+ "violet-60": "#7958D6",
108
+ "violet-70": "#593CAC",
109
+ "violet-80": "#422A86",
110
+ "violet-90": "#1F0E51",
111
+ "yellow-10": "#FFF8D9",
112
+ "yellow-20": "#FFF1B2",
113
+ "yellow-30": "#FFE166",
114
+ "yellow-40": "#FFCD00",
115
+ "yellow-50": "#E5B800",
116
+ "yellow-60": "#B69200",
117
+ "yellow-70": "#846A01",
118
+ "yellow-80": "#604D00",
119
+ "yellow-90": "#423500"
120
+ }, p = (e) => ({
121
+ ...e,
122
+ "primary-10": e["yellow-10"],
123
+ "primary-20": e["yellow-20"],
124
+ "primary-30": e["yellow-30"],
125
+ "primary-40": e["yellow-40"],
126
+ "primary-50": e["yellow-50"],
127
+ "primary-60": e["yellow-60"],
128
+ "primary-70": e["yellow-70"],
129
+ "primary-80": e["yellow-80"],
130
+ "primary-90": e["yellow-90"],
131
+ "secondary-blue": e["blue-40"],
132
+ "secondary-green": e["green-30"],
133
+ "secondary-orange": e["red-orange-40"],
134
+ "secondary-pink": e["pink-40"],
135
+ "secondary-teal": e["teal-40"],
136
+ "secondary-violet": e["violet-40"],
137
+ overlay: "rgba(0, 0, 0, 0.55)"
138
+ }), c = p(x), b = Object.keys(c).reduce((e, t) => {
139
+ if (t.startsWith("secondary-") || t === "overlay") return e;
140
+ const o = 100 - Number(t.slice(-2)), l = t.slice(0, t.length - 2);
141
+ return {
142
+ ...e,
143
+ [t]: c[`${l}${o}`]
144
+ };
145
+ }, {}), w = {
146
+ ...c,
147
+ ...p(b)
148
+ }, J = {
149
+ colors: w
150
+ }, A = (e) => ({
151
+ "welcome-font": [
152
+ {
153
+ url: `${e.fontsUrl}/welcome-font-regular`,
154
+ weight: "400"
155
+ },
156
+ {
157
+ url: `${e.fontsUrl}/welcome-font-medium`,
158
+ weight: "500"
159
+ },
160
+ {
161
+ url: `${e.fontsUrl}/welcome-font-bold`,
162
+ weight: "600"
163
+ },
164
+ {
165
+ url: `${e.fontsUrl}/welcome-font-regular-italic`,
166
+ style: "italic",
167
+ weight: "400"
168
+ },
169
+ {
170
+ url: `${e.fontsUrl}/welcome-font-medium-italic`,
171
+ style: "italic",
172
+ weight: "500"
173
+ },
174
+ {
175
+ url: `${e.fontsUrl}/welcome-font-bold-italic`,
176
+ style: "italic",
177
+ weight: "600"
178
+ }
179
+ ],
180
+ "welcome-icon-font": [
181
+ {
182
+ url: `${e.fontsUrl}/icon-font/__ICON_FONT_HASH__/welcome-icon-font`,
183
+ display: "block"
184
+ }
185
+ ],
186
+ "work-sans": [
187
+ {
188
+ url: `${e.fontsUrl}/work-sans-variable`,
189
+ isVariable: !0,
190
+ stretch: "75% 125%",
191
+ weight: "100 1000"
192
+ }
193
+ ]
194
+ }), E = (e, t) => {
195
+ const { toEm: o, toRem: l } = t, n = l;
196
+ return {
197
+ h0: n(65),
198
+ h1: n(45),
199
+ h2: n(36),
200
+ h3: n(26),
201
+ h4: n(20),
202
+ h5: n(16),
203
+ h6: n(14),
204
+ lg: n(18),
205
+ md: n(16),
206
+ sm: n(14),
207
+ "subtitle-md": n(13),
208
+ "subtitle-sm": n(11),
209
+ xs: n(12)
210
+ };
211
+ }, y = ({
212
+ defaultLineHeight: e,
213
+ toRem: t
214
+ }) => ({
215
+ html: e,
216
+ h0: t(72),
217
+ h1: t(48),
218
+ h2: t(40),
219
+ h3: t(32),
220
+ h4: t(24),
221
+ h5: t(18),
222
+ h6: t(16),
223
+ lg: t(24),
224
+ md: t(18),
225
+ sm: t(18),
226
+ xs: t(14),
227
+ "subtitle-md": e,
228
+ "subtitle-sm": e
229
+ }), D = {
230
+ regular: 400,
231
+ medium: 500,
232
+ bold: 600
233
+ }, T = ({
234
+ defaultLetterSpacing: e,
235
+ toRem: t
236
+ }) => ({
237
+ html: e,
238
+ h0: t(-1.7),
239
+ h1: t(-1.2),
240
+ h2: t(-1),
241
+ h3: t(-0.9),
242
+ h4: t(-0.6),
243
+ h5: t(-0.5),
244
+ h6: t(-0.5),
245
+ lg: e,
246
+ md: e,
247
+ sm: e,
248
+ xs: t(-0.2),
249
+ "subtitle-md": t(-0.2),
250
+ "subtitle-sm": t(-0.2)
251
+ }), B = (e) => {
252
+ const { fontWeights: t } = e;
253
+ return {
254
+ h0: t.bold,
255
+ h1: t.bold,
256
+ h2: t.bold,
257
+ h3: t.bold,
258
+ h4: t.bold,
259
+ h5: t.bold,
260
+ h6: t.bold,
261
+ lg: t.regular,
262
+ md: t.regular,
263
+ sm: t.regular,
264
+ "subtitle-md": t.bold,
265
+ "subtitle-sm": t.medium,
266
+ xs: t.regular
267
+ };
268
+ }, v = (e) => {
269
+ const { fonts: t } = e;
270
+ return {
271
+ h0: t.headings,
272
+ h1: t.headings,
273
+ h2: t.headings,
274
+ h3: t.headings,
275
+ h4: t.headings,
276
+ h5: t.headings,
277
+ h6: t.headings,
278
+ "subtitle-md": t.headings,
279
+ "subtitle-sm": t.headings
280
+ };
281
+ }, C = () => ({
282
+ "subtitle-md": "uppercase",
283
+ "subtitle-sm": "uppercase"
284
+ }), _ = (e) => {
285
+ const { colors: t } = e;
286
+ return {
287
+ h0: t["neutral-90"],
288
+ h1: t["neutral-90"],
289
+ h2: t["neutral-90"],
290
+ h3: t["neutral-90"],
291
+ h4: t["neutral-90"],
292
+ h5: t["neutral-90"],
293
+ h6: t["neutral-90"]
294
+ };
295
+ }, $ = (e) => {
296
+ const {
297
+ fontSizes: t,
298
+ letterSpacings: o,
299
+ lineHeights: l,
300
+ textsFontColors: n,
301
+ textsFontFamily: F,
302
+ textsFontWeights: g,
303
+ textsTextTransform: u
304
+ } = e;
305
+ return Object.keys(t).reduce((s, r) => ({
306
+ ...s,
307
+ [r]: {
308
+ color: n[r],
309
+ fontFamily: F[r] || void 0,
310
+ fontWeight: g[r],
311
+ fontSize: t[r],
312
+ lineHeight: l[r] || l.lg,
313
+ letterSpacing: o[r] || void 0,
314
+ textTransform: u[r] || void 0
315
+ }
316
+ }), {});
317
+ }, k = (e, t, o) => ({
318
+ texts: [e, "sans-serif"].join(", "),
319
+ headings: [t, "sans-serif"].join(", "),
320
+ icons: o
321
+ }), a = {
322
+ primary: "ease",
323
+ secondary: "linear",
324
+ tertiary: "cubic-bezier(0.41, 0.094, 0.54, 0.07)"
325
+ }, S = {
326
+ slow: `500ms ${a.tertiary}`,
327
+ medium: `300ms ${a.primary}`,
328
+ fast: `100ms ${a.secondary}`
329
+ }, U = ({ colors: e }) => ({
330
+ default: m`
331
+ background-image: linear-gradient(
332
+ 0deg,
333
+ ${e["primary-40"]},
334
+ ${e["primary-40"]} 100%
335
+ );
336
+ background-repeat: no-repeat;
337
+ background-size: 100% 50%;
338
+ background-position-y: calc(200% - 2px);
339
+ transition:
340
+ background-position-y 250ms,
341
+ background-size 250ms,
342
+ color 250ms;
343
+ `,
344
+ hover: m`
345
+ opacity: 1;
346
+ background-position-y: 100%;
347
+ background-size: 100% 100%;
348
+ `
349
+ }), N = (e) => ({
350
+ none: "0",
351
+ sm: e.toRem(2),
352
+ md: e.toRem(4),
353
+ lg: e.toRem(8),
354
+ xl: e.toRem(16),
355
+ xxl: e.toRem(24),
356
+ full: "100%"
357
+ }), W = {
358
+ sm: "1px",
359
+ md: "2px",
360
+ lg: "3px"
361
+ }, L = {
362
+ xs: 0,
363
+ sm: 480,
364
+ md: 736,
365
+ lg: 980,
366
+ xl: 1280,
367
+ xxl: 1440,
368
+ "3xl": 1620,
369
+ "4xl": 1920
370
+ }, O = {
371
+ sm: "1px 2px 4px 0 rgba(0,0,0,0.05)",
372
+ md: "3px 4px 10px 0 rgba(0,0,0,0.07)"
373
+ }, I = (e) => ({
374
+ xxs: e.toRem(2),
375
+ xs: e.toRem(4),
376
+ sm: e.toRem(8),
377
+ md: e.toRem(12),
378
+ lg: e.toRem(16),
379
+ xl: e.toRem(24),
380
+ xxl: e.toRem(32),
381
+ "3xl": e.toRem(48),
382
+ "4xl": e.toRem(64),
383
+ "5xl": e.toRem(96),
384
+ "6xl": e.toRem(128),
385
+ "7xl": e.toRem(192)
386
+ }), z = (e) => ({
387
+ backgroundColor: e.colors["primary-40"],
388
+ color: e.colors["neutral-90"]
389
+ }), H = ({ colors: e }) => {
390
+ function t(o = e["primary-40"]) {
391
+ return {
392
+ boxShadow: `0 0 0 2px ${o}`
393
+ };
394
+ }
395
+ return t;
396
+ }, P = "work-sans", R = 16, G = "-0.019rem", M = 1.15, Y = "https://cdn.welcome-ui.com/fonts", V = "welcome-font", Z = "welcome-icon-font", K = (e = {}) => {
397
+ const {
398
+ defaultFontFamily: t = P,
399
+ defaultFontSize: o = R,
400
+ defaultLetterSpacing: l = G,
401
+ defaultLineHeight: n = M,
402
+ fontsUrl: F = Y,
403
+ headingFontFamily: g = V,
404
+ iconFontFamily: u = Z,
405
+ ...s
406
+ } = e;
407
+ let r = {};
408
+ return r.transformers = { ...h }, r.toEm = (i) => `${i / o}em`, r.toRem = (i) => `${i / o}rem`, r.toPx = (i) => `${i * o}px`, r.colors = c, r.fontsUrl = F, r.fontFaces = A(r), r.fontSizes = E("rem", r), r.defaultLineHeight = n, r.defaultLetterSpacing = l, r.lineHeights = y(r), r.fontWeights = D, r.letterSpacings = T(r), r.fonts = k(t, g, u), r.borderWidths = W, r.screens = L, r.space = I(r), r.inset = r.space, r.radii = N(r), r.transitions = S, r.timingFunction = a, r.shadows = O, r = d(r, s), r.selection = z(r), r.underline = U(r), r.focus = H(r), r.textsFontWeights = B(r), r.textsFontFamily = v(r), r.textsFontColors = _(r), r.textsTextTransform = C(), r.texts = $(r), r.states = f.states, r = d(r, s), r;
409
+ };
410
+ export {
411
+ j as Box,
412
+ ae as WuiProvider,
413
+ te as componentSystem,
414
+ K as createTheme,
415
+ J as darkTheme,
416
+ re as filterSystemProps,
417
+ ne as forwardRef,
418
+ oe as shouldForwardProp,
419
+ le as system,
420
+ ie as wrapperSystem
421
+ };
package/dist/system.js ADDED
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),t=require("@xstyled/styled-components");function a(o){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const p=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(r,s,p.get?p:{enumerable:!0,get:()=>o[s]})}}return r.default=o,Object.freeze(r)}const e=a(t),i=t.compose(t.style({prop:"opacity"}),t.style({prop:"overflow"}),t.style({prop:"transition",themeGet:t.getTransition}),t.style({prop:"position"}),t.style({prop:"zIndex",themeGet:t.getZIndex}),t.style({prop:"top",themeGet:t.getPx}),t.style({prop:"right",themeGet:t.getPx}),t.style({prop:"bottom",themeGet:t.getPx}),t.style({prop:"left",themeGet:t.getPx})),l=Object.freeze([e.backgrounds,e.borders,e.boxShadow,e.color,e.display,e.flexboxes,e.grids,e.height,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.space,e.typography,e.verticalAlign,e.width,i]),d=Object.freeze([e.margin,e.marginBottom,e.marginLeft,e.marginRight,e.marginTop,e.mx,e.my,e.width,i]),n=t.compose(...l),c=t.compose(...d),f=n.meta.props.filter(o=>!c.meta.props.includes(o)).map(o=>o==="w"?e.width:o==="h"?e.height:e[o]).filter(Boolean),g=t.compose(...f),y=o=>!n.meta.props.includes(o),u=(o,r)=>r(o),h=o=>m.forwardRef(o);exports.componentSystem=g;exports.filterSystemProps=y;exports.forwardRef=h;exports.shouldForwardProp=u;exports.system=n;exports.wrapperSystem=c;
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import m from "react";
3
+ import * as t from "@xstyled/styled-components";
4
+ import { compose as p, style as o, getTransition as a, getZIndex as c, getPx as r } from "@xstyled/styled-components";
5
+ const i = p(
6
+ o({ prop: "opacity" }),
7
+ o({ prop: "overflow" }),
8
+ o({ prop: "transition", themeGet: a }),
9
+ o({ prop: "position" }),
10
+ o({ prop: "zIndex", themeGet: c }),
11
+ o({ prop: "top", themeGet: r }),
12
+ o({ prop: "right", themeGet: r }),
13
+ o({ prop: "bottom", themeGet: r }),
14
+ o({ prop: "left", themeGet: r })
15
+ ), h = Object.freeze([
16
+ t.backgrounds,
17
+ t.borders,
18
+ t.boxShadow,
19
+ t.color,
20
+ t.display,
21
+ t.flexboxes,
22
+ t.grids,
23
+ t.height,
24
+ t.maxHeight,
25
+ t.maxWidth,
26
+ t.minHeight,
27
+ t.minWidth,
28
+ t.space,
29
+ t.typography,
30
+ t.verticalAlign,
31
+ t.width,
32
+ i
33
+ ]), d = Object.freeze([
34
+ t.margin,
35
+ t.marginBottom,
36
+ t.marginLeft,
37
+ t.marginRight,
38
+ t.marginTop,
39
+ t.mx,
40
+ t.my,
41
+ t.width,
42
+ i
43
+ ]), n = p(...h), f = p(...d), g = n.meta.props.filter((e) => !f.meta.props.includes(e)).map((e) => e === "w" ? t.width : e === "h" ? t.height : t[e]).filter(Boolean), w = p(...g), x = (e) => !n.meta.props.includes(e), y = (e, s) => s(e), u = (e) => m.forwardRef(e);
44
+ export {
45
+ w as componentSystem,
46
+ x as filterSystemProps,
47
+ u as forwardRef,
48
+ y as shouldForwardProp,
49
+ n as system,
50
+ f as wrapperSystem
51
+ };
@@ -0,0 +1,3 @@
1
+ import { CreateWuiProps } from '../System';
2
+ export type BoxProps = Omit<CreateWuiProps<'div'>, 'dataTestId'>;
3
+ export declare const Box: import('../System').CreateWuiComponent<"div", BoxProps>;
@@ -0,0 +1,40 @@
1
+ import { default as React } from 'react';
2
+ import { SystemProps } from '@xstyled/styled-components';
3
+ import { StyledConfig } from 'styled-components';
4
+ import * as S from '@xstyled/styled-components';
5
+ /**
6
+ * @deprecated use system from @xstyled/syled-components instead
7
+ */
8
+ export declare const system: S.StyleGenerator<WuiSystemProps>;
9
+ /**
10
+ * @deprecated use system from @xstyled/syled-components instead
11
+ */
12
+ export declare const wrapperSystem: S.StyleGenerator<WuiWrapperSystemProps>;
13
+ /**
14
+ * @deprecated use system from @xstyled/syled-components instead
15
+ */
16
+ export declare const componentSystem: S.StyleGenerator<unknown>;
17
+ export declare const filterSystemProps: (prop: string) => boolean;
18
+ export declare const shouldForwardProp: StyledConfig['shouldForwardProp'];
19
+ export type WuiOldProps = S.OpacityProps & S.OverflowProps & S.TransitionProps & S.ZIndexProps & S.TopProps & S.RightProps & S.BottomProps & S.LeftProps;
20
+ export type WuiSystemProps = S.BackgroundsProps & S.BorderProps & S.BoxShadowProps & S.ColorProps & S.DisplayProps & S.FlexboxesProps & S.GridsProps & S.HeightProps & S.MaxHeightProps & S.MaxWidthProps & S.MinHeightProps & S.MinWidthProps & S.SpaceProps & S.TypographyProps & S.VerticalAlignProps & S.WidthProps & WuiOldProps;
21
+ export type WuiWrapperSystemProps = S.MarginProps & S.MarginBottomProps & S.MarginLeftProps & S.MarginRightProps & S.MarginTopProps & S.MarginXProps & S.MarginYProps & S.WidthProps & WuiOldProps;
22
+ export interface WuiTestProps {
23
+ dataTestId?: string;
24
+ }
25
+ export type WuiProps = SystemProps;
26
+ export type As<Props = any> = React.ElementType<Props>;
27
+ export type RightJoinProps<SourceProps, OverrideProps> = Omit<SourceProps, keyof OverrideProps> & OverrideProps;
28
+ export type MergeProps<ComponentProps, Props, WuiProps> = RightJoinProps<ComponentProps, Props> & RightJoinProps<WuiProps, Props>;
29
+ export type CreateWuiProps<Component extends As, Props = {}> = MergeProps<Omit<React.ComponentProps<Component>, keyof WuiProps>, Props, WuiProps & WuiTestProps & {
30
+ as?: As;
31
+ }>;
32
+ export type CreateWuiComponent<Component extends As, Options = {}> = {
33
+ <AsComponent extends As>(props: CreateWuiProps<AsComponent, Options> & {
34
+ as: AsComponent;
35
+ }): JSX.Element;
36
+ (props: CreateWuiProps<Component, Options>): JSX.Element;
37
+ displayName?: string;
38
+ };
39
+ export declare const forwardRef: <Component extends As, Props = {}>(component: React.ForwardRefRenderFunction<any, Props>) => CreateWuiComponent<Component, Props>;
40
+ export type ExtraSize = number | string;
@@ -0,0 +1,16 @@
1
+ import { css } from '@xstyled/styled-components';
2
+ import { ThemeValues } from '../../theme';
3
+ type FontVariation = {
4
+ display?: FontDisplay;
5
+ extensions?: string[];
6
+ isVariable?: boolean;
7
+ style?: string;
8
+ unicodeRange?: string;
9
+ url: string;
10
+ weight?: string;
11
+ };
12
+ export declare function getSource(url: FontVariation['url'], extensions: FontVariation['extensions'], isVariable: FontVariation['isVariable']): string;
13
+ export declare const fonts: () => ({ theme }: {
14
+ theme: ThemeValues;
15
+ }) => ReturnType<typeof css>;
16
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export declare const hideFocusRingsDataAttribute = "data-wui-hidefocusrings";
3
+ interface HideFocusRingsRootProps {
4
+ children?: React.ReactNode;
5
+ reactRootId: string;
6
+ }
7
+ export declare const HideFocusRingsRoot: React.FC<HideFocusRingsRootProps>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { ThemeValues } from '../../theme';
3
+ export interface WuiProviderProps {
4
+ children?: React.ReactNode;
5
+ hasGlobalStyle?: boolean;
6
+ reactRootId?: string;
7
+ shouldHideFocusRingOnClick?: boolean;
8
+ theme: ThemeValues;
9
+ useReset?: boolean;
10
+ }
11
+ export declare const WuiProvider: React.FC<WuiProviderProps>;
@@ -0,0 +1,5 @@
1
+ export declare const resetStyles: import('styled-components').FlattenSimpleInterpolation;
2
+ export declare const normalizeStyle: import('styled-components').FlattenSimpleInterpolation;
3
+ export declare const GlobalStyle: import('styled-components').GlobalStyleComponent<{
4
+ useReset?: boolean;
5
+ }, import('styled-components').DefaultTheme>;
@@ -0,0 +1,3 @@
1
+ export * from './Box';
2
+ export * from './System';
3
+ export * from './WuiProvider';
@@ -0,0 +1,2 @@
1
+ export * from './theme';
2
+ export * from './components';
@@ -0,0 +1,6 @@
1
+ export type ThemeBorderWidths = {
2
+ lg: string;
3
+ md: string;
4
+ sm: string;
5
+ };
6
+ export declare const borderWidths: ThemeBorderWidths;