ndcloud-storybook 1.0.1 → 1.2.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.
package/dist/index.cjs CHANGED
@@ -53,6 +53,79 @@ var Spinner = ({
53
53
  }
54
54
  ) });
55
55
  var Spinner_default = Spinner;
56
+
57
+ // src/tokens/colors.ts
58
+ var colors = {
59
+ // Brand colors
60
+ baseColors: {
61
+ // Brand
62
+ primaryGreen: "#7EE896",
63
+ primaryPurple: "#6D65DA",
64
+ // Palette
65
+ darkBlue1: "#12131B",
66
+ darkBlue2: "#2A2B33",
67
+ darkBlue3: "#02061D",
68
+ grey1: "#3C3C44",
69
+ grey2: "#45454F",
70
+ grey3: "#9CA3AF",
71
+ grey4: "#8E8E98",
72
+ grey5: "#4B4B4B",
73
+ grey6: "#353535",
74
+ grey7: "#ECECED",
75
+ white1: "#ffffff"
76
+ },
77
+ // Hover states
78
+ hoverColors: {
79
+ primaryPurple: "#5F56D6"
80
+ },
81
+ // Background colors
82
+ backgrounds: {
83
+ light1: "#F5F6F8",
84
+ light2: "#EFF1F8",
85
+ transparent: "transparent"
86
+ },
87
+ // Accents (errors, warnings, etc.)
88
+ accents: {
89
+ error: "#F2545B",
90
+ danger: "#D25E4A",
91
+ warning: "#ECAC4D"
92
+ },
93
+ // Gradients
94
+ gradients: {
95
+ gradient1: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)"
96
+ }
97
+ };
98
+
99
+ // src/tokens/typography.ts
100
+ var FONT_WEIGHTS = {
101
+ light: 300,
102
+ regular: 350,
103
+ normal: 400,
104
+ medium: 500,
105
+ bold: 700
106
+ };
107
+ var FONT_SIZES = {
108
+ xxs: 10,
109
+ xs: 12,
110
+ s: 13,
111
+ m: 14,
112
+ base: 16,
113
+ lg: 18,
114
+ xl: 20,
115
+ "2xl": 24
116
+ };
117
+ var typography = {
118
+ fontFamily: {
119
+ primary: '"ABCFavoritExtended", sans-serif'
120
+ },
121
+ fontWeight: FONT_WEIGHTS,
122
+ fontSize: FONT_SIZES,
123
+ lineHeight: {
124
+ tight: 1.2,
125
+ normal: 1.5,
126
+ relaxed: 1.75
127
+ }
128
+ };
56
129
  var Variant = /* @__PURE__ */ ((Variant2) => {
57
130
  Variant2["Primary"] = "primary";
58
131
  Variant2["Secondary"] = "secondary";
@@ -61,15 +134,15 @@ var Variant = /* @__PURE__ */ ((Variant2) => {
61
134
  })(Variant || {});
62
135
  var VARIANTS = {
63
136
  primary: {
64
- background: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)",
65
- color: "#FFF"
137
+ background: colors.gradients.gradient1,
138
+ color: colors.baseColors.white1
66
139
  },
67
140
  secondary: {
68
- background: "#6D65DA",
69
- color: "#FFF"
141
+ background: colors.baseColors.primaryPurple,
142
+ color: colors.baseColors.white1
70
143
  },
71
144
  outline: {
72
- background: "transparent",
145
+ background: colors.backgrounds.transparent,
73
146
  border: "1px solid rgba(70, 70, 74, 0.10)",
74
147
  color: "#0E1116D9"
75
148
  }
@@ -80,8 +153,8 @@ var StyledButton = styled__default.default.button`
80
153
  justify-content: center;
81
154
  padding: 12px 20px;
82
155
  border-radius: 100px;
83
- font-weight: 500;
84
- font-family: "ABCFavoritExtended", sans-serif;
156
+ font-weight: ${typography.fontWeight.medium};
157
+ font-family: ${typography.fontFamily.primary};
85
158
  transition: all 0.2s ease;
86
159
  width: 100%;
87
160
  max-width: 336px;
@@ -97,8 +170,8 @@ var StyledButton = styled__default.default.button`
97
170
  const { background, color, border } = VARIANTS[variant];
98
171
  return react.css`
99
172
  background: ${background};
100
- border: ${selected ? "2px solid #FFF" : border || "none"};
101
- color: ${color || "#FFF"};
173
+ border: ${selected ? `2px solid ${colors.baseColors.white1}` : border || "none"};
174
+ color: ${color || colors.baseColors.white1};
102
175
  opacity: ${disabled ? 0.5 : 1};
103
176
  cursor: ${disabled ? "not-allowed" : "pointer"};
104
177
  pointer-events: ${disabled ? "none" : "auto"};
@@ -132,7 +205,259 @@ var Button = ({
132
205
  );
133
206
  var Button_default = Button;
134
207
 
208
+ // src/utils/colorHelpers.ts
209
+ function getOpacity(hexColor, opacity) {
210
+ const hex = hexColor.trim().replace(/^#/, "");
211
+ if (!/^[\da-fA-F]{6}$/.test(hex)) {
212
+ throw new Error(`Invalid hex color: ${hexColor}`);
213
+ }
214
+ const opacityFraction = Math.round(opacity / 100 * 255);
215
+ const alphaHex = opacityFraction.toString(16).padStart(2, "0");
216
+ return `#${hex}${alphaHex}`;
217
+ }
218
+
219
+ // src/atoms/shared/inputStyles.ts
220
+ var defaultPadding = "9px 17px";
221
+ var focusedPadding = "8px 16px";
222
+ var baseInputStyles = react.css`
223
+ border-radius: 10px;
224
+ border: 1px solid ${colors.baseColors.grey7};
225
+ padding: ${defaultPadding};
226
+ color: ${getOpacity(colors.baseColors.darkBlue3, 80)};
227
+ background-color: ${colors.baseColors.white1};
228
+ font-weight: ${typography.fontWeight.regular};
229
+ cursor: text;
230
+ transition: border-color 0.2s ease;
231
+ box-sizing: border-box;
232
+
233
+ &::placeholder {
234
+ color: ${colors.baseColors.grey3};
235
+ }
236
+
237
+ &:hover:not(:disabled) {
238
+ cursor: text;
239
+ }
240
+
241
+ &:focus {
242
+ outline: none;
243
+ border-width: 2px;
244
+ border-color: ${colors.baseColors.primaryPurple};
245
+ padding: ${focusedPadding};
246
+ }
247
+
248
+ &:disabled {
249
+ background-color: ${colors.baseColors.grey7};
250
+ cursor: not-allowed;
251
+ }
252
+ `;
253
+ var errorStyles = react.css`
254
+ border-width: 2px;
255
+ border-color: ${colors.accents.error};
256
+ padding: ${focusedPadding};
257
+
258
+ &:focus {
259
+ border-width: 2px;
260
+ border-color: ${colors.accents.error};
261
+ padding: ${focusedPadding};
262
+ }
263
+ `;
264
+ var warningStyles = react.css`
265
+ border-width: 2px;
266
+ border-color: ${colors.accents.warning};
267
+ padding: ${focusedPadding};
268
+
269
+ &:focus {
270
+ border-width: 2px;
271
+ border-color: ${colors.accents.warning};
272
+ padding: ${focusedPadding};
273
+ }
274
+ `;
275
+ var Input = ({ className, error, warning, ...rest }) => {
276
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledInput, { className, error, warning, ...rest });
277
+ };
278
+ var Input_default = Input;
279
+ var StyledInput = styled__default.default.input`
280
+ ${baseInputStyles}
281
+
282
+ ${({ error }) => error && errorStyles}
283
+ ${({ warning }) => warning && warningStyles}
284
+ `;
285
+ var Label = ({ className, htmlFor, children, ...rest }) => {
286
+ return /* @__PURE__ */ jsxRuntime.jsx("label", { className, htmlFor, ...rest, children });
287
+ };
288
+ var Label_default = Label;
289
+ var Textarea = ({ className, error, warning, ...rest }) => {
290
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledTextarea, { className, error, warning, ...rest });
291
+ };
292
+ var Textarea_default = Textarea;
293
+ var StyledTextarea = styled__default.default.textarea`
294
+ ${baseInputStyles}
295
+ resize: vertical;
296
+ min-height: 80px;
297
+ font-family: inherit;
298
+
299
+ ${({ error }) => error && errorStyles}
300
+ ${({ warning }) => warning && warningStyles}
301
+ `;
302
+ var Tab = ({
303
+ children,
304
+ selected,
305
+ fontSize = "m",
306
+ className,
307
+ ...rest
308
+ }) => {
309
+ return /* @__PURE__ */ jsxRuntime.jsx(
310
+ StyledTab,
311
+ {
312
+ className,
313
+ selected,
314
+ fontSize,
315
+ ...rest,
316
+ children
317
+ }
318
+ );
319
+ };
320
+ var Tab_default = Tab;
321
+ var StyledTab = styled__default.default.div`
322
+ display: inline-block;
323
+ padding: 8px 16px;
324
+ user-select: none;
325
+ font-size: ${({ fontSize }) => `${typography.fontSize[fontSize]}px`};
326
+ position: relative;
327
+ transition: border-color 0.2s ease;
328
+ cursor: pointer;
329
+
330
+ ${({ selected }) => selected && `
331
+ &::after {
332
+ content: '';
333
+ position: absolute;
334
+ bottom: -1px;
335
+ left: 0;
336
+ right: 0;
337
+ height: 3px;
338
+ background-color: ${colors.baseColors.primaryGreen};
339
+ }
340
+ `}
341
+ `;
342
+ var HelperText = styled__default.default.div`
343
+ margin-top: 4px;
344
+ font-size: ${typography.fontSize.xs}px;
345
+ color: ${({ error, warning }) => {
346
+ if (error) return colors.accents.error;
347
+ if (warning) return colors.accents.warning;
348
+ return colors.baseColors.grey3;
349
+ }};
350
+ `;
351
+ var FormField = ({
352
+ id,
353
+ label,
354
+ helperText,
355
+ error,
356
+ warning,
357
+ onInput,
358
+ onChange,
359
+ className,
360
+ ...inputProps
361
+ }) => {
362
+ const handleChange = (event) => {
363
+ if (onInput) {
364
+ onInput(event.target.value);
365
+ }
366
+ if (onChange) {
367
+ onChange(event);
368
+ }
369
+ };
370
+ const displayText = error || warning || helperText;
371
+ const hasError = !!error;
372
+ const hasWarning = !!warning && !hasError;
373
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormFieldWrapper, { className, children: [
374
+ /* @__PURE__ */ jsxRuntime.jsx(Label_default, { htmlFor: id, children: label }),
375
+ /* @__PURE__ */ jsxRuntime.jsx(
376
+ Input_default,
377
+ {
378
+ id,
379
+ onChange: handleChange,
380
+ error: hasError,
381
+ warning: hasWarning,
382
+ ...inputProps
383
+ }
384
+ ),
385
+ displayText && /* @__PURE__ */ jsxRuntime.jsx(HelperText, { error: hasError, warning: hasWarning, children: displayText })
386
+ ] });
387
+ };
388
+ var FormFieldWrapper = styled__default.default.div`
389
+ display: flex;
390
+ flex-direction: column;
391
+
392
+ label {
393
+ margin-bottom: 8px;
394
+ color: ${colors.baseColors.darkBlue3};
395
+ font-size: ${typography.fontSize.m}px;
396
+ }
397
+ `;
398
+ var FormField_default = FormField;
399
+ var FormFieldTextarea = ({
400
+ id,
401
+ label,
402
+ helperText,
403
+ error,
404
+ warning,
405
+ onInput,
406
+ onChange,
407
+ className,
408
+ ...textareaProps
409
+ }) => {
410
+ const handleChange = (event) => {
411
+ if (onInput) {
412
+ onInput(event.target.value);
413
+ }
414
+ if (onChange) {
415
+ onChange(event);
416
+ }
417
+ };
418
+ const displayText = error || warning || helperText;
419
+ const hasError = !!error;
420
+ const hasWarning = !!warning && !hasError;
421
+ return /* @__PURE__ */ jsxRuntime.jsxs(FormFieldWrapper2, { className, children: [
422
+ /* @__PURE__ */ jsxRuntime.jsx(Label_default, { htmlFor: id, children: label }),
423
+ /* @__PURE__ */ jsxRuntime.jsx(
424
+ Textarea_default,
425
+ {
426
+ id,
427
+ onChange: handleChange,
428
+ error: hasError,
429
+ warning: hasWarning,
430
+ ...textareaProps
431
+ }
432
+ ),
433
+ displayText && /* @__PURE__ */ jsxRuntime.jsx(HelperText, { error: hasError, warning: hasWarning, children: displayText })
434
+ ] });
435
+ };
436
+ var FormFieldWrapper2 = styled__default.default.div`
437
+ display: flex;
438
+ flex-direction: column;
439
+
440
+ label {
441
+ margin-bottom: 8px;
442
+ color: ${colors.baseColors.darkBlue3};
443
+ font-size: ${typography.fontSize.m}px;
444
+ }
445
+ `;
446
+ var FormFieldTextarea_default = FormFieldTextarea;
447
+
135
448
  exports.Button = Button_default;
449
+ exports.FONT_SIZES = FONT_SIZES;
450
+ exports.FONT_WEIGHTS = FONT_WEIGHTS;
451
+ exports.FormField = FormField_default;
452
+ exports.FormFieldTextarea = FormFieldTextarea_default;
453
+ exports.HelperText = HelperText;
454
+ exports.Input = Input_default;
455
+ exports.Label = Label_default;
456
+ exports.Tab = Tab_default;
457
+ exports.Textarea = Textarea_default;
136
458
  exports.Variant = Variant;
459
+ exports.colors = colors;
460
+ exports.getOpacity = getOpacity;
461
+ exports.typography = typography;
137
462
  //# sourceMappingURL=index.cjs.map
138
463
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/atoms/Spinner/Spinner.tsx","../src/atoms/Button/Button.tsx"],"names":["keyframes","styled","jsx","jsxs","Variant","css","Fragment"],"mappings":";;;;;;;;;;;AAYA,IAAM,IAAA,GAAOA,eAAA;AAAA;AAAA;AAAA,CAAA;AAKb,IAAM,UAAUC,uBAAA,CAAO,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,WAAA,EAMV,C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AA,EAAC,YAAA;AAAA,EAAA;AAAA,IACC,KAAA,EAAO,EAAA;AAAA,IACP,UAAU,QAAA,IAAY,OAAA;AAAA,IACtB,SAAA;AAAA,IACC,GAAG,IAAA;AAAA,IAEH,oCACCA,cAAAA,CAAC,mBAAQ,CAAA,mBAETC,gBAAAG,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,IAAA,oBAAQJ,cAAAA,CAAC,MAAA,EAAA,EAAM,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,MACpB;AAAA,KAAA,EACH;AAAA;AAEJ,CAAA;AAGF,IAAO,cAAA,GAAQ","file":"index.cjs","sourcesContent":["/** @jsxImportSource @emotion/react */\nimport React from \"react\";\nimport { keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\n\ninterface SpinnerProps {\n size?: number;\n speed?: string;\n bgColor?: string;\n fgColor?: string;\n}\n\nconst spin = keyframes`\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n`;\n\nconst Wrapper = styled.div<SpinnerProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n svg {\n width: ${({ size = 20 }) => size}px;\n height: ${({ size = 20 }) => size}px;\n animation: ${spin} ${({ speed = \"0.75s\" }) => speed} linear infinite;\n transform-origin: center;\n }\n`;\n\nconst Spinner: React.FC<SpinnerProps> = ({\n size = 20,\n speed = \"0.75s\",\n bgColor = \"#D1D5DB\",\n fgColor = \"#FFFFFF\",\n}) => (\n <Wrapper size={size} speed={speed}>\n <svg\n viewBox=\"0 0 50 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"status\"\n aria-label=\"loading\"\n >\n <circle cx=\"25\" cy=\"25\" r=\"20\" stroke={bgColor} strokeWidth=\"5\" />\n <path\n d=\"M45 25a20 20 0 0 1-20 20\"\n stroke={fgColor}\n strokeWidth=\"5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </Wrapper>\n);\n\nexport default Spinner;\n","/** @jsxImportSource @emotion/react */\nimport { css } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { ReactNode } from \"react\";\nimport Spinner from \"../Spinner/Spinner\";\n\ntype VariantName = \"primary\" | \"secondary\" | \"outline\";\n\nexport enum Variant {\n Primary = \"primary\",\n Secondary = \"secondary\",\n Outline = \"outline\",\n}\n\ninterface VariantStyle {\n background: string;\n color?: string;\n border?: string;\n}\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n variant?: VariantName;\n disabled?: boolean;\n selected?: boolean;\n icon?: ReactNode;\n loading?: boolean;\n className?: string;\n}\n\nconst VARIANTS: Record<VariantName, VariantStyle> = {\n primary: {\n background: \"linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)\",\n color: \"#FFF\",\n },\n secondary: {\n background: \"#6D65DA\",\n color: \"#FFF\",\n },\n outline: {\n background: \"transparent\",\n border: \"1px solid rgba(70, 70, 74, 0.10)\",\n color: \"#0E1116D9\",\n },\n};\n\nconst StyledButton = styled.button<ButtonProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n border-radius: 100px;\n font-weight: 500;\n font-family: \"ABCFavoritExtended\", sans-serif;\n transition: all 0.2s ease;\n width: 100%;\n max-width: 336px;\n\n span {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n }\n\n ${({ variant = \"primary\", disabled, selected }) => {\n const { background, color, border } = VARIANTS[variant];\n return css`\n background: ${background};\n border: ${selected ? \"2px solid #FFF\" : border || \"none\"};\n color: ${color || \"#FFF\"};\n opacity: ${disabled ? 0.5 : 1};\n cursor: ${disabled ? \"not-allowed\" : \"pointer\"};\n pointer-events: ${disabled ? \"none\" : \"auto\"};\n\n &:focus-visible {\n outline: 2px solid #0070f3;\n outline-offset: 2px;\n }\n `;\n }}\n`;\n\nconst Button: React.FC<ButtonProps> = ({\n label,\n icon,\n loading,\n disabled,\n className,\n ...rest\n}) => (\n <StyledButton\n label={\"\"}\n disabled={disabled || loading}\n className={className}\n {...rest}\n >\n {loading ? (\n <Spinner />\n ) : (\n <>\n {icon && <span>{icon}</span>}\n {label}\n </>\n )}\n </StyledButton>\n);\n\nexport default Button;\n"]}
1
+ {"version":3,"sources":["../src/atoms/Spinner/Spinner.tsx","../src/tokens/colors.ts","../src/tokens/typography.ts","../src/atoms/Button/Button.tsx","../src/utils/colorHelpers.ts","../src/atoms/shared/inputStyles.ts","../src/atoms/Input/Input.tsx","../src/atoms/Label/Label.tsx","../src/atoms/Textarea/Textarea.tsx","../src/atoms/Tab/Tab.tsx","../src/atoms/HelperText/HelperText.tsx","../src/molecules/FormField/FormField.tsx","../src/molecules/FormFieldTextarea/FormFieldTextarea.tsx"],"names":["keyframes","styled","jsx","jsxs","Variant","css","Fragment","FormFieldWrapper"],"mappings":";;;;;;;;;;;AAYA,IAAM,IAAA,GAAOA,eAAA;AAAA;AAAA;AAAA,CAAA;AAKb,IAAM,UAAUC,uBAAA,CAAO,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,WAAA,EAMV,CAAC,EAAE,IAAA,GAAO,EAAA,OAAS,IAAI,CAAA;AAAA,YAAA,EACtB,CAAC,EAAE,IAAA,GAAO,EAAA,OAAS,IAAI,CAAA;AAAA,eAAA,EACpB,IAAI,CAAA,CAAA,EAAI,CAAC,EAAE,KAAA,GAAQ,OAAA,OAAc,KAAK,CAAA;AAAA;AAAA;AAAA,CAAA;AAKvD,IAAM,UAAkC,CAAC;AAAA,EACvC,IAAA,GAAO,EAAA;AAAA,EACP,KAAA,GAAQ,OAAA;AAAA,EACR,OAAA,GAAU,SAAA;AAAA,EACV,OAAA,GAAU;AACZ,CAAA,qBACEC,cAAA,CAAC,OAAA,EAAA,EAAQ,IAAA,EAAY,KAAA,EACnB,QAAA,kBAAAC,eAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,OAAA,EAAQ,WAAA;AAAA,IACR,IAAA,EAAK,MAAA;AAAA,IACL,KAAA,EAAM,4BAA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CAAC,QAAA;AAEjC,EAAA,uBACEE,eAAAA,CAACI,iBAAAA,EAAA,EAAiB,SAAA,EAChB,QAAA,EAAA;AAAA,oBAAAL,cAAAA,CAAC,aAAA,EAAA,EAAM,OAAA,EAAS,EAAA,EAAK,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,oBAC3BA,cAAAA;AAAA,MAAC,gBAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,QAAA,EAAU,YAAA;AAAA,QACV,KAAA,EAAO,QAAA;AAAA,QACP,OAAA,EAAS,UAAA;AAAA,QACR,GAAG;AAAA;AAAA,KACN;AAAA,IACC,WAAA,oBACCA,cAAAA,CAAC,UAAA,EAAA,EAAW,OAAO,QAAA,EAAU,OAAA,EAAS,YACnC,QAAA,EAAA,WAAA,EACH;AAAA,GAAA,EAEJ,CAAA;AAEJ,CAAA;AAEA,IAAMK,oBAAmBN,uBAAAA,CAAO,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAA,EAMnB,MAAA,CAAO,WAAW,SAAS,CAAA;AAAA,eAAA,EACvB,UAAA,CAAW,SAAS,CAAC,CAAA;AAAA;AAAA,CAAA;AAItC,IAAO,yBAAA,GAAQ","file":"index.cjs","sourcesContent":["/** @jsxImportSource @emotion/react */\nimport React from \"react\";\nimport { keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\n\ninterface SpinnerProps {\n size?: number;\n speed?: string;\n bgColor?: string;\n fgColor?: string;\n}\n\nconst spin = keyframes`\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n`;\n\nconst Wrapper = styled.div<SpinnerProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n svg {\n width: ${({ size = 20 }) => size}px;\n height: ${({ size = 20 }) => size}px;\n animation: ${spin} ${({ speed = \"0.75s\" }) => speed} linear infinite;\n transform-origin: center;\n }\n`;\n\nconst Spinner: React.FC<SpinnerProps> = ({\n size = 20,\n speed = \"0.75s\",\n bgColor = \"#D1D5DB\",\n fgColor = \"#FFFFFF\",\n}) => (\n <Wrapper size={size} speed={speed}>\n <svg\n viewBox=\"0 0 50 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"status\"\n aria-label=\"loading\"\n >\n <circle cx=\"25\" cy=\"25\" r=\"20\" stroke={bgColor} strokeWidth=\"5\" />\n <path\n d=\"M45 25a20 20 0 0 1-20 20\"\n stroke={fgColor}\n strokeWidth=\"5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </Wrapper>\n);\n\nexport default Spinner;\n","/**\n * Color tokens for the design system\n */\n\nexport const colors = {\n // Brand colors\n baseColors: {\n // Brand\n primaryGreen: \"#7EE896\",\n primaryPurple: \"#6D65DA\",\n\n // Palette\n darkBlue1: \"#12131B\",\n darkBlue2: \"#2A2B33\",\n darkBlue3: \"#02061D\",\n\n grey1: \"#3C3C44\",\n grey2: \"#45454F\",\n grey3: \"#9CA3AF\",\n grey4: \"#8E8E98\",\n grey5: \"#4B4B4B\",\n grey6: \"#353535\",\n grey7: \"#ECECED\",\n\n white1: \"#ffffff\",\n },\n\n // Hover states\n hoverColors: {\n primaryPurple: \"#5F56D6\",\n },\n\n // Background colors\n backgrounds: {\n light1: \"#F5F6F8\",\n light2: \"#EFF1F8\",\n transparent: \"transparent\",\n },\n\n // Accents (errors, warnings, etc.)\n accents: {\n error: \"#F2545B\",\n danger: \"#D25E4A\",\n warning: \"#ECAC4D\",\n },\n\n // Gradients\n gradients: {\n gradient1: \"linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)\",\n },\n} as const;\n\nexport type Colors = typeof colors;\n\n","export type Typography = typeof typography;\n\nexport type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];\nexport type FontSize = (typeof FONT_SIZES)[keyof typeof FONT_SIZES];\nexport type Align = \"left\" | \"center\" | \"right\";\n/**\n * Typography tokens for the design system\n */\n\nexport const FONT_WEIGHTS = {\n light: 300,\n regular: 350,\n normal: 400,\n medium: 500,\n bold: 700,\n} as const;\n\nexport const FONT_SIZES = {\n xxs: 10,\n xs: 12,\n s: 13,\n m: 14,\n base: 16,\n lg: 18,\n xl: 20,\n \"2xl\": 24,\n} as const;\n\nexport const typography = {\n fontFamily: {\n primary: '\"ABCFavoritExtended\", sans-serif',\n },\n\n fontWeight: FONT_WEIGHTS,\n\n fontSize: FONT_SIZES,\n\n lineHeight: {\n tight: 1.2,\n normal: 1.5,\n relaxed: 1.75,\n },\n} as const;\n\n","/** @jsxImportSource @emotion/react */\nimport { css } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { ReactNode } from \"react\";\nimport Spinner from \"../Spinner/Spinner\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\ntype VariantName = \"primary\" | \"secondary\" | \"outline\";\n\nexport enum Variant {\n Primary = \"primary\",\n Secondary = \"secondary\",\n Outline = \"outline\",\n}\n\ninterface VariantStyle {\n background: string;\n color?: string;\n border?: string;\n}\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n variant?: VariantName;\n disabled?: boolean;\n selected?: boolean;\n icon?: ReactNode;\n loading?: boolean;\n className?: string;\n}\n\nconst VARIANTS: Record<VariantName, VariantStyle> = {\n primary: {\n background: colors.gradients.gradient1,\n color: colors.baseColors.white1,\n },\n secondary: {\n background: colors.baseColors.primaryPurple,\n color: colors.baseColors.white1,\n },\n outline: {\n background: colors.backgrounds.transparent,\n border: \"1px solid rgba(70, 70, 74, 0.10)\",\n color: \"#0E1116D9\",\n },\n};\n\nconst StyledButton = styled.button<ButtonProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n border-radius: 100px;\n font-weight: ${typography.fontWeight.medium};\n font-family: ${typography.fontFamily.primary};\n transition: all 0.2s ease;\n width: 100%;\n max-width: 336px;\n\n span {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n }\n\n ${({ variant = \"primary\", disabled, selected }) => {\n const { background, color, border } = VARIANTS[variant];\n return css`\n background: ${background};\n border: ${selected ? `2px solid ${colors.baseColors.white1}` : border || \"none\"};\n color: ${color || colors.baseColors.white1};\n opacity: ${disabled ? 0.5 : 1};\n cursor: ${disabled ? \"not-allowed\" : \"pointer\"};\n pointer-events: ${disabled ? \"none\" : \"auto\"};\n\n &:focus-visible {\n outline: 2px solid #0070f3;\n outline-offset: 2px;\n }\n `;\n }}\n`;\n\nconst Button: React.FC<ButtonProps> = ({\n label,\n icon,\n loading,\n disabled,\n className,\n ...rest\n}) => (\n <StyledButton\n label={\"\"}\n disabled={disabled || loading}\n className={className}\n {...rest}\n >\n {loading ? (\n <Spinner />\n ) : (\n <>\n {icon && <span>{icon}</span>}\n {label}\n </>\n )}\n </StyledButton>\n);\n\nexport default Button;\n","/**\n * Color utility functions for the design system\n */\n\nexport type TOpacity = number; // 0-100\nexport type TColor = string; // Hex color with alpha channel\n\n/**\n * Converts a hex color to a hex color with alpha channel\n * @param hexColor - Hex color string (e.g., \"#6D65DA\" or \"6D65DA\")\n * @param opacity - Opacity value from 0-100\n * @returns Hex color with alpha channel (e.g., \"#6D65DAB3\" for 70% opacity)\n * @throws Error if hex color is invalid\n */\nexport function getOpacity(hexColor: string, opacity: TOpacity): TColor {\n const hex = hexColor.trim().replace(/^#/, \"\");\n \n if (!/^[\\da-fA-F]{6}$/.test(hex)) {\n throw new Error(`Invalid hex color: ${hexColor}`);\n }\n\n const opacityFraction = Math.round((opacity / 100) * 255);\n const alphaHex = opacityFraction.toString(16).padStart(2, \"0\");\n\n return `#${hex}${alphaHex}`;\n}\n\n","import { css } from \"@emotion/react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { getOpacity } from \"../../utils/colorHelpers\";\n\nexport const defaultPadding = \"9px 17px\";\nexport const focusedPadding = \"8px 16px\";\n\nexport const baseInputStyles = css`\n border-radius: 10px;\n border: 1px solid ${colors.baseColors.grey7};\n padding: ${defaultPadding};\n color: ${getOpacity(colors.baseColors.darkBlue3, 80)};\n background-color: ${colors.baseColors.white1};\n font-weight: ${typography.fontWeight.regular};\n cursor: text;\n transition: border-color 0.2s ease;\n box-sizing: border-box;\n\n &::placeholder {\n color: ${colors.baseColors.grey3};\n }\n\n &:hover:not(:disabled) {\n cursor: text;\n }\n\n &:focus {\n outline: none;\n border-width: 2px;\n border-color: ${colors.baseColors.primaryPurple};\n padding: ${focusedPadding};\n }\n\n &:disabled {\n background-color: ${colors.baseColors.grey7};\n cursor: not-allowed;\n }\n`;\n\nexport const errorStyles = css`\n border-width: 2px;\n border-color: ${colors.accents.error};\n padding: ${focusedPadding};\n\n &:focus {\n border-width: 2px;\n border-color: ${colors.accents.error};\n padding: ${focusedPadding};\n }\n`;\n\nexport const warningStyles = css`\n border-width: 2px;\n border-color: ${colors.accents.warning};\n padding: ${focusedPadding};\n\n &:focus {\n border-width: 2px;\n border-color: ${colors.accents.warning};\n padding: ${focusedPadding};\n }\n`;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { baseInputStyles, errorStyles, warningStyles } from \"../shared/inputStyles\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n error?: boolean;\n warning?: boolean;\n}\n\nconst Input: React.FC<InputProps> = ({ className, error, warning, ...rest }) => {\n return <StyledInput className={className} error={error} warning={warning} {...rest} />;\n};\n\nexport default Input;\n\nconst StyledInput = styled.input<InputProps>`\n ${baseInputStyles}\n\n ${({ error }) => error && errorStyles}\n ${({ warning }) => warning && warningStyles}\n`;","import React from \"react\";\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement> {\n className?: string;\n htmlFor?: string;\n}\n\nconst Label: React.FC<LabelProps> = ({ className, htmlFor, children, ...rest }) => {\n return (\n <label className={className} htmlFor={htmlFor} {...rest}>\n {children}\n </label>\n );\n};\n\nexport default Label;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { baseInputStyles, errorStyles, warningStyles } from \"../shared/inputStyles\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n className?: string;\n error?: boolean;\n warning?: boolean;\n}\n\nconst Textarea: React.FC<TextareaProps> = ({ className, error, warning, ...rest }) => {\n return <StyledTextarea className={className} error={error} warning={warning} {...rest} />;\n};\n\nexport default Textarea;\n\nconst StyledTextarea = styled.textarea<TextareaProps>`\n ${baseInputStyles}\n resize: vertical;\n min-height: 80px;\n font-family: inherit;\n\n ${({ error }) => error && errorStyles}\n ${({ warning }) => warning && warningStyles}\n`;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography, FONT_SIZES } from \"../../tokens/typography\";\n\ntype FontSizeKey = keyof typeof FONT_SIZES;\n\nexport interface TabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"fontSize\"> {\n children: React.ReactNode;\n selected?: boolean;\n fontSize?: FontSizeKey;\n className?: string;\n}\n\ninterface StyledTabProps {\n selected?: boolean;\n fontSize: FontSizeKey;\n}\n\nconst Tab: React.FC<TabProps> = ({\n children,\n selected,\n fontSize = \"m\",\n className,\n ...rest\n}) => {\n return (\n <StyledTab\n className={className}\n selected={selected}\n fontSize={fontSize}\n {...rest}\n >\n {children}\n </StyledTab>\n );\n};\n\nexport default Tab;\n\nconst StyledTab = styled.div<StyledTabProps>`\n display: inline-block;\n padding: 8px 16px;\n user-select: none;\n font-size: ${({ fontSize }) => `${typography.fontSize[fontSize]}px`};\n position: relative;\n transition: border-color 0.2s ease;\n cursor: pointer;\n\n ${({ selected }) =>\n selected &&\n `\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n height: 3px;\n background-color: ${colors.baseColors.primaryGreen};\n }\n `}\n`;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface HelperTextProps {\n error?: boolean;\n warning?: boolean;\n children: React.ReactNode;\n}\n\nexport const HelperText = styled.div<HelperTextProps>`\n margin-top: 4px;\n font-size: ${typography.fontSize.xs}px;\n color: ${({ error, warning }) => {\n if (error) return colors.accents.error;\n if (warning) return colors.accents.warning;\n return colors.baseColors.grey3;\n }};\n`;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport Input, { InputProps } from \"../../atoms/Input\";\nimport Label from \"../../atoms/Label\";\nimport { HelperText } from \"../../atoms/HelperText\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface FormFieldProps extends Omit<InputProps, \"id\" | \"onInput\" | \"error\" | \"warning\"> {\n id: string;\n label: string;\n helperText?: string;\n error?: string;\n warning?: string;\n onInput?: (value: string) => void;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nconst FormField: React.FC<FormFieldProps> = ({\n id,\n label,\n helperText,\n error,\n warning,\n onInput,\n onChange,\n className,\n ...inputProps\n}) => {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onInput) {\n onInput(event.target.value);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n const displayText = error || warning || helperText;\n const hasError = !!error;\n const hasWarning = !!warning && !hasError;\n\n return (\n <FormFieldWrapper className={className}>\n <Label htmlFor={id}>{label}</Label>\n <Input\n id={id}\n onChange={handleChange}\n error={hasError}\n warning={hasWarning}\n {...inputProps}\n />\n {displayText && (\n <HelperText error={hasError} warning={hasWarning}>\n {displayText}\n </HelperText>\n )}\n </FormFieldWrapper>\n );\n};\n\nconst FormFieldWrapper = styled.div`\n display: flex;\n flex-direction: column;\n \n label {\n margin-bottom: 8px;\n color: ${colors.baseColors.darkBlue3};\n font-size: ${typography.fontSize.m}px;\n }\n`;\n\nexport default FormField;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport Textarea, { TextareaProps } from \"../../atoms/Textarea\";\nimport Label from \"../../atoms/Label\";\nimport { HelperText } from \"../../atoms/HelperText\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface FormFieldTextareaProps extends Omit<TextareaProps, \"id\" | \"onInput\" | \"error\" | \"warning\"> {\n id: string;\n label: string;\n helperText?: string;\n error?: string;\n warning?: string;\n onInput?: (value: string) => void;\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\nconst FormFieldTextarea: React.FC<FormFieldTextareaProps> = ({\n id,\n label,\n helperText,\n error,\n warning,\n onInput,\n onChange,\n className,\n ...textareaProps\n}) => {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (onInput) {\n onInput(event.target.value);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n const displayText = error || warning || helperText;\n const hasError = !!error;\n const hasWarning = !!warning && !hasError;\n\n return (\n <FormFieldWrapper className={className}>\n <Label htmlFor={id}>{label}</Label>\n <Textarea\n id={id}\n onChange={handleChange}\n error={hasError}\n warning={hasWarning}\n {...textareaProps}\n />\n {displayText && (\n <HelperText error={hasError} warning={hasWarning}>\n {displayText}\n </HelperText>\n )}\n </FormFieldWrapper>\n );\n};\n\nconst FormFieldWrapper = styled.div`\n display: flex;\n flex-direction: column;\n \n label {\n margin-bottom: 8px;\n color: ${colors.baseColors.darkBlue3};\n font-size: ${typography.fontSize.m}px;\n }\n`;\n\nexport default FormFieldTextarea;\n\n"]}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import * as _emotion_styled from '@emotion/styled';
3
+ import * as _emotion_react from '@emotion/react';
2
4
 
3
5
  type VariantName = "primary" | "secondary" | "outline";
4
6
  declare enum Variant {
@@ -17,4 +19,169 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
17
19
  }
18
20
  declare const Button: React.FC<ButtonProps>;
19
21
 
20
- export { Button, type ButtonProps, Variant };
22
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
23
+ className?: string;
24
+ error?: boolean;
25
+ warning?: boolean;
26
+ }
27
+ declare const Input: React.FC<InputProps>;
28
+
29
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
30
+ className?: string;
31
+ htmlFor?: string;
32
+ }
33
+ declare const Label: React.FC<LabelProps>;
34
+
35
+ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
36
+ className?: string;
37
+ error?: boolean;
38
+ warning?: boolean;
39
+ }
40
+ declare const Textarea: React.FC<TextareaProps>;
41
+
42
+ type Typography = typeof typography;
43
+ type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
44
+ type FontSize = (typeof FONT_SIZES)[keyof typeof FONT_SIZES];
45
+ type Align = "left" | "center" | "right";
46
+ /**
47
+ * Typography tokens for the design system
48
+ */
49
+ declare const FONT_WEIGHTS: {
50
+ readonly light: 300;
51
+ readonly regular: 350;
52
+ readonly normal: 400;
53
+ readonly medium: 500;
54
+ readonly bold: 700;
55
+ };
56
+ declare const FONT_SIZES: {
57
+ readonly xxs: 10;
58
+ readonly xs: 12;
59
+ readonly s: 13;
60
+ readonly m: 14;
61
+ readonly base: 16;
62
+ readonly lg: 18;
63
+ readonly xl: 20;
64
+ readonly "2xl": 24;
65
+ };
66
+ declare const typography: {
67
+ readonly fontFamily: {
68
+ readonly primary: "\"ABCFavoritExtended\", sans-serif";
69
+ };
70
+ readonly fontWeight: {
71
+ readonly light: 300;
72
+ readonly regular: 350;
73
+ readonly normal: 400;
74
+ readonly medium: 500;
75
+ readonly bold: 700;
76
+ };
77
+ readonly fontSize: {
78
+ readonly xxs: 10;
79
+ readonly xs: 12;
80
+ readonly s: 13;
81
+ readonly m: 14;
82
+ readonly base: 16;
83
+ readonly lg: 18;
84
+ readonly xl: 20;
85
+ readonly "2xl": 24;
86
+ };
87
+ readonly lineHeight: {
88
+ readonly tight: 1.2;
89
+ readonly normal: 1.5;
90
+ readonly relaxed: 1.75;
91
+ };
92
+ };
93
+
94
+ type FontSizeKey = keyof typeof FONT_SIZES;
95
+ interface TabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "fontSize"> {
96
+ children: React.ReactNode;
97
+ selected?: boolean;
98
+ fontSize?: FontSizeKey;
99
+ className?: string;
100
+ }
101
+ declare const Tab: React.FC<TabProps>;
102
+
103
+ interface HelperTextProps {
104
+ error?: boolean;
105
+ warning?: boolean;
106
+ children: React.ReactNode;
107
+ }
108
+ declare const HelperText: _emotion_styled.StyledComponent<{
109
+ theme?: _emotion_react.Theme;
110
+ as?: React.ElementType;
111
+ } & HelperTextProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
112
+
113
+ interface FormFieldProps extends Omit<InputProps, "id" | "onInput" | "error" | "warning"> {
114
+ id: string;
115
+ label: string;
116
+ helperText?: string;
117
+ error?: string;
118
+ warning?: string;
119
+ onInput?: (value: string) => void;
120
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
121
+ }
122
+ declare const FormField: React.FC<FormFieldProps>;
123
+
124
+ interface FormFieldTextareaProps extends Omit<TextareaProps, "id" | "onInput" | "error" | "warning"> {
125
+ id: string;
126
+ label: string;
127
+ helperText?: string;
128
+ error?: string;
129
+ warning?: string;
130
+ onInput?: (value: string) => void;
131
+ onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
132
+ }
133
+ declare const FormFieldTextarea: React.FC<FormFieldTextareaProps>;
134
+
135
+ /**
136
+ * Color tokens for the design system
137
+ */
138
+ declare const colors: {
139
+ readonly baseColors: {
140
+ readonly primaryGreen: "#7EE896";
141
+ readonly primaryPurple: "#6D65DA";
142
+ readonly darkBlue1: "#12131B";
143
+ readonly darkBlue2: "#2A2B33";
144
+ readonly darkBlue3: "#02061D";
145
+ readonly grey1: "#3C3C44";
146
+ readonly grey2: "#45454F";
147
+ readonly grey3: "#9CA3AF";
148
+ readonly grey4: "#8E8E98";
149
+ readonly grey5: "#4B4B4B";
150
+ readonly grey6: "#353535";
151
+ readonly grey7: "#ECECED";
152
+ readonly white1: "#ffffff";
153
+ };
154
+ readonly hoverColors: {
155
+ readonly primaryPurple: "#5F56D6";
156
+ };
157
+ readonly backgrounds: {
158
+ readonly light1: "#F5F6F8";
159
+ readonly light2: "#EFF1F8";
160
+ readonly transparent: "transparent";
161
+ };
162
+ readonly accents: {
163
+ readonly error: "#F2545B";
164
+ readonly danger: "#D25E4A";
165
+ readonly warning: "#ECAC4D";
166
+ };
167
+ readonly gradients: {
168
+ readonly gradient1: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)";
169
+ };
170
+ };
171
+ type Colors = typeof colors;
172
+
173
+ /**
174
+ * Color utility functions for the design system
175
+ */
176
+ type TOpacity = number;
177
+ type TColor = string;
178
+ /**
179
+ * Converts a hex color to a hex color with alpha channel
180
+ * @param hexColor - Hex color string (e.g., "#6D65DA" or "6D65DA")
181
+ * @param opacity - Opacity value from 0-100
182
+ * @returns Hex color with alpha channel (e.g., "#6D65DAB3" for 70% opacity)
183
+ * @throws Error if hex color is invalid
184
+ */
185
+ declare function getOpacity(hexColor: string, opacity: TOpacity): TColor;
186
+
187
+ export { type Align, Button, type ButtonProps, type Colors, FONT_SIZES, FONT_WEIGHTS, type FontSize, type FontWeight, FormField, type FormFieldProps, FormFieldTextarea, type FormFieldTextareaProps, HelperText, type HelperTextProps, Input, type InputProps, Label, type LabelProps, type TColor, type TOpacity, Tab, type TabProps, Textarea, type TextareaProps, type Typography, Variant, colors, getOpacity, typography };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import * as _emotion_styled from '@emotion/styled';
3
+ import * as _emotion_react from '@emotion/react';
2
4
 
3
5
  type VariantName = "primary" | "secondary" | "outline";
4
6
  declare enum Variant {
@@ -17,4 +19,169 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
17
19
  }
18
20
  declare const Button: React.FC<ButtonProps>;
19
21
 
20
- export { Button, type ButtonProps, Variant };
22
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
23
+ className?: string;
24
+ error?: boolean;
25
+ warning?: boolean;
26
+ }
27
+ declare const Input: React.FC<InputProps>;
28
+
29
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
30
+ className?: string;
31
+ htmlFor?: string;
32
+ }
33
+ declare const Label: React.FC<LabelProps>;
34
+
35
+ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
36
+ className?: string;
37
+ error?: boolean;
38
+ warning?: boolean;
39
+ }
40
+ declare const Textarea: React.FC<TextareaProps>;
41
+
42
+ type Typography = typeof typography;
43
+ type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
44
+ type FontSize = (typeof FONT_SIZES)[keyof typeof FONT_SIZES];
45
+ type Align = "left" | "center" | "right";
46
+ /**
47
+ * Typography tokens for the design system
48
+ */
49
+ declare const FONT_WEIGHTS: {
50
+ readonly light: 300;
51
+ readonly regular: 350;
52
+ readonly normal: 400;
53
+ readonly medium: 500;
54
+ readonly bold: 700;
55
+ };
56
+ declare const FONT_SIZES: {
57
+ readonly xxs: 10;
58
+ readonly xs: 12;
59
+ readonly s: 13;
60
+ readonly m: 14;
61
+ readonly base: 16;
62
+ readonly lg: 18;
63
+ readonly xl: 20;
64
+ readonly "2xl": 24;
65
+ };
66
+ declare const typography: {
67
+ readonly fontFamily: {
68
+ readonly primary: "\"ABCFavoritExtended\", sans-serif";
69
+ };
70
+ readonly fontWeight: {
71
+ readonly light: 300;
72
+ readonly regular: 350;
73
+ readonly normal: 400;
74
+ readonly medium: 500;
75
+ readonly bold: 700;
76
+ };
77
+ readonly fontSize: {
78
+ readonly xxs: 10;
79
+ readonly xs: 12;
80
+ readonly s: 13;
81
+ readonly m: 14;
82
+ readonly base: 16;
83
+ readonly lg: 18;
84
+ readonly xl: 20;
85
+ readonly "2xl": 24;
86
+ };
87
+ readonly lineHeight: {
88
+ readonly tight: 1.2;
89
+ readonly normal: 1.5;
90
+ readonly relaxed: 1.75;
91
+ };
92
+ };
93
+
94
+ type FontSizeKey = keyof typeof FONT_SIZES;
95
+ interface TabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "fontSize"> {
96
+ children: React.ReactNode;
97
+ selected?: boolean;
98
+ fontSize?: FontSizeKey;
99
+ className?: string;
100
+ }
101
+ declare const Tab: React.FC<TabProps>;
102
+
103
+ interface HelperTextProps {
104
+ error?: boolean;
105
+ warning?: boolean;
106
+ children: React.ReactNode;
107
+ }
108
+ declare const HelperText: _emotion_styled.StyledComponent<{
109
+ theme?: _emotion_react.Theme;
110
+ as?: React.ElementType;
111
+ } & HelperTextProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
112
+
113
+ interface FormFieldProps extends Omit<InputProps, "id" | "onInput" | "error" | "warning"> {
114
+ id: string;
115
+ label: string;
116
+ helperText?: string;
117
+ error?: string;
118
+ warning?: string;
119
+ onInput?: (value: string) => void;
120
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
121
+ }
122
+ declare const FormField: React.FC<FormFieldProps>;
123
+
124
+ interface FormFieldTextareaProps extends Omit<TextareaProps, "id" | "onInput" | "error" | "warning"> {
125
+ id: string;
126
+ label: string;
127
+ helperText?: string;
128
+ error?: string;
129
+ warning?: string;
130
+ onInput?: (value: string) => void;
131
+ onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
132
+ }
133
+ declare const FormFieldTextarea: React.FC<FormFieldTextareaProps>;
134
+
135
+ /**
136
+ * Color tokens for the design system
137
+ */
138
+ declare const colors: {
139
+ readonly baseColors: {
140
+ readonly primaryGreen: "#7EE896";
141
+ readonly primaryPurple: "#6D65DA";
142
+ readonly darkBlue1: "#12131B";
143
+ readonly darkBlue2: "#2A2B33";
144
+ readonly darkBlue3: "#02061D";
145
+ readonly grey1: "#3C3C44";
146
+ readonly grey2: "#45454F";
147
+ readonly grey3: "#9CA3AF";
148
+ readonly grey4: "#8E8E98";
149
+ readonly grey5: "#4B4B4B";
150
+ readonly grey6: "#353535";
151
+ readonly grey7: "#ECECED";
152
+ readonly white1: "#ffffff";
153
+ };
154
+ readonly hoverColors: {
155
+ readonly primaryPurple: "#5F56D6";
156
+ };
157
+ readonly backgrounds: {
158
+ readonly light1: "#F5F6F8";
159
+ readonly light2: "#EFF1F8";
160
+ readonly transparent: "transparent";
161
+ };
162
+ readonly accents: {
163
+ readonly error: "#F2545B";
164
+ readonly danger: "#D25E4A";
165
+ readonly warning: "#ECAC4D";
166
+ };
167
+ readonly gradients: {
168
+ readonly gradient1: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)";
169
+ };
170
+ };
171
+ type Colors = typeof colors;
172
+
173
+ /**
174
+ * Color utility functions for the design system
175
+ */
176
+ type TOpacity = number;
177
+ type TColor = string;
178
+ /**
179
+ * Converts a hex color to a hex color with alpha channel
180
+ * @param hexColor - Hex color string (e.g., "#6D65DA" or "6D65DA")
181
+ * @param opacity - Opacity value from 0-100
182
+ * @returns Hex color with alpha channel (e.g., "#6D65DAB3" for 70% opacity)
183
+ * @throws Error if hex color is invalid
184
+ */
185
+ declare function getOpacity(hexColor: string, opacity: TOpacity): TColor;
186
+
187
+ export { type Align, Button, type ButtonProps, type Colors, FONT_SIZES, FONT_WEIGHTS, type FontSize, type FontWeight, FormField, type FormFieldProps, FormFieldTextarea, type FormFieldTextareaProps, HelperText, type HelperTextProps, Input, type InputProps, Label, type LabelProps, type TColor, type TOpacity, Tab, type TabProps, Textarea, type TextareaProps, type Typography, Variant, colors, getOpacity, typography };
package/dist/index.js CHANGED
@@ -47,6 +47,79 @@ var Spinner = ({
47
47
  }
48
48
  ) });
49
49
  var Spinner_default = Spinner;
50
+
51
+ // src/tokens/colors.ts
52
+ var colors = {
53
+ // Brand colors
54
+ baseColors: {
55
+ // Brand
56
+ primaryGreen: "#7EE896",
57
+ primaryPurple: "#6D65DA",
58
+ // Palette
59
+ darkBlue1: "#12131B",
60
+ darkBlue2: "#2A2B33",
61
+ darkBlue3: "#02061D",
62
+ grey1: "#3C3C44",
63
+ grey2: "#45454F",
64
+ grey3: "#9CA3AF",
65
+ grey4: "#8E8E98",
66
+ grey5: "#4B4B4B",
67
+ grey6: "#353535",
68
+ grey7: "#ECECED",
69
+ white1: "#ffffff"
70
+ },
71
+ // Hover states
72
+ hoverColors: {
73
+ primaryPurple: "#5F56D6"
74
+ },
75
+ // Background colors
76
+ backgrounds: {
77
+ light1: "#F5F6F8",
78
+ light2: "#EFF1F8",
79
+ transparent: "transparent"
80
+ },
81
+ // Accents (errors, warnings, etc.)
82
+ accents: {
83
+ error: "#F2545B",
84
+ danger: "#D25E4A",
85
+ warning: "#ECAC4D"
86
+ },
87
+ // Gradients
88
+ gradients: {
89
+ gradient1: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)"
90
+ }
91
+ };
92
+
93
+ // src/tokens/typography.ts
94
+ var FONT_WEIGHTS = {
95
+ light: 300,
96
+ regular: 350,
97
+ normal: 400,
98
+ medium: 500,
99
+ bold: 700
100
+ };
101
+ var FONT_SIZES = {
102
+ xxs: 10,
103
+ xs: 12,
104
+ s: 13,
105
+ m: 14,
106
+ base: 16,
107
+ lg: 18,
108
+ xl: 20,
109
+ "2xl": 24
110
+ };
111
+ var typography = {
112
+ fontFamily: {
113
+ primary: '"ABCFavoritExtended", sans-serif'
114
+ },
115
+ fontWeight: FONT_WEIGHTS,
116
+ fontSize: FONT_SIZES,
117
+ lineHeight: {
118
+ tight: 1.2,
119
+ normal: 1.5,
120
+ relaxed: 1.75
121
+ }
122
+ };
50
123
  var Variant = /* @__PURE__ */ ((Variant2) => {
51
124
  Variant2["Primary"] = "primary";
52
125
  Variant2["Secondary"] = "secondary";
@@ -55,15 +128,15 @@ var Variant = /* @__PURE__ */ ((Variant2) => {
55
128
  })(Variant || {});
56
129
  var VARIANTS = {
57
130
  primary: {
58
- background: "linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)",
59
- color: "#FFF"
131
+ background: colors.gradients.gradient1,
132
+ color: colors.baseColors.white1
60
133
  },
61
134
  secondary: {
62
- background: "#6D65DA",
63
- color: "#FFF"
135
+ background: colors.baseColors.primaryPurple,
136
+ color: colors.baseColors.white1
64
137
  },
65
138
  outline: {
66
- background: "transparent",
139
+ background: colors.backgrounds.transparent,
67
140
  border: "1px solid rgba(70, 70, 74, 0.10)",
68
141
  color: "#0E1116D9"
69
142
  }
@@ -74,8 +147,8 @@ var StyledButton = styled.button`
74
147
  justify-content: center;
75
148
  padding: 12px 20px;
76
149
  border-radius: 100px;
77
- font-weight: 500;
78
- font-family: "ABCFavoritExtended", sans-serif;
150
+ font-weight: ${typography.fontWeight.medium};
151
+ font-family: ${typography.fontFamily.primary};
79
152
  transition: all 0.2s ease;
80
153
  width: 100%;
81
154
  max-width: 336px;
@@ -91,8 +164,8 @@ var StyledButton = styled.button`
91
164
  const { background, color, border } = VARIANTS[variant];
92
165
  return css`
93
166
  background: ${background};
94
- border: ${selected ? "2px solid #FFF" : border || "none"};
95
- color: ${color || "#FFF"};
167
+ border: ${selected ? `2px solid ${colors.baseColors.white1}` : border || "none"};
168
+ color: ${color || colors.baseColors.white1};
96
169
  opacity: ${disabled ? 0.5 : 1};
97
170
  cursor: ${disabled ? "not-allowed" : "pointer"};
98
171
  pointer-events: ${disabled ? "none" : "auto"};
@@ -126,6 +199,246 @@ var Button = ({
126
199
  );
127
200
  var Button_default = Button;
128
201
 
129
- export { Button_default as Button, Variant };
202
+ // src/utils/colorHelpers.ts
203
+ function getOpacity(hexColor, opacity) {
204
+ const hex = hexColor.trim().replace(/^#/, "");
205
+ if (!/^[\da-fA-F]{6}$/.test(hex)) {
206
+ throw new Error(`Invalid hex color: ${hexColor}`);
207
+ }
208
+ const opacityFraction = Math.round(opacity / 100 * 255);
209
+ const alphaHex = opacityFraction.toString(16).padStart(2, "0");
210
+ return `#${hex}${alphaHex}`;
211
+ }
212
+
213
+ // src/atoms/shared/inputStyles.ts
214
+ var defaultPadding = "9px 17px";
215
+ var focusedPadding = "8px 16px";
216
+ var baseInputStyles = css`
217
+ border-radius: 10px;
218
+ border: 1px solid ${colors.baseColors.grey7};
219
+ padding: ${defaultPadding};
220
+ color: ${getOpacity(colors.baseColors.darkBlue3, 80)};
221
+ background-color: ${colors.baseColors.white1};
222
+ font-weight: ${typography.fontWeight.regular};
223
+ cursor: text;
224
+ transition: border-color 0.2s ease;
225
+ box-sizing: border-box;
226
+
227
+ &::placeholder {
228
+ color: ${colors.baseColors.grey3};
229
+ }
230
+
231
+ &:hover:not(:disabled) {
232
+ cursor: text;
233
+ }
234
+
235
+ &:focus {
236
+ outline: none;
237
+ border-width: 2px;
238
+ border-color: ${colors.baseColors.primaryPurple};
239
+ padding: ${focusedPadding};
240
+ }
241
+
242
+ &:disabled {
243
+ background-color: ${colors.baseColors.grey7};
244
+ cursor: not-allowed;
245
+ }
246
+ `;
247
+ var errorStyles = css`
248
+ border-width: 2px;
249
+ border-color: ${colors.accents.error};
250
+ padding: ${focusedPadding};
251
+
252
+ &:focus {
253
+ border-width: 2px;
254
+ border-color: ${colors.accents.error};
255
+ padding: ${focusedPadding};
256
+ }
257
+ `;
258
+ var warningStyles = css`
259
+ border-width: 2px;
260
+ border-color: ${colors.accents.warning};
261
+ padding: ${focusedPadding};
262
+
263
+ &:focus {
264
+ border-width: 2px;
265
+ border-color: ${colors.accents.warning};
266
+ padding: ${focusedPadding};
267
+ }
268
+ `;
269
+ var Input = ({ className, error, warning, ...rest }) => {
270
+ return /* @__PURE__ */ jsx(StyledInput, { className, error, warning, ...rest });
271
+ };
272
+ var Input_default = Input;
273
+ var StyledInput = styled.input`
274
+ ${baseInputStyles}
275
+
276
+ ${({ error }) => error && errorStyles}
277
+ ${({ warning }) => warning && warningStyles}
278
+ `;
279
+ var Label = ({ className, htmlFor, children, ...rest }) => {
280
+ return /* @__PURE__ */ jsx("label", { className, htmlFor, ...rest, children });
281
+ };
282
+ var Label_default = Label;
283
+ var Textarea = ({ className, error, warning, ...rest }) => {
284
+ return /* @__PURE__ */ jsx(StyledTextarea, { className, error, warning, ...rest });
285
+ };
286
+ var Textarea_default = Textarea;
287
+ var StyledTextarea = styled.textarea`
288
+ ${baseInputStyles}
289
+ resize: vertical;
290
+ min-height: 80px;
291
+ font-family: inherit;
292
+
293
+ ${({ error }) => error && errorStyles}
294
+ ${({ warning }) => warning && warningStyles}
295
+ `;
296
+ var Tab = ({
297
+ children,
298
+ selected,
299
+ fontSize = "m",
300
+ className,
301
+ ...rest
302
+ }) => {
303
+ return /* @__PURE__ */ jsx(
304
+ StyledTab,
305
+ {
306
+ className,
307
+ selected,
308
+ fontSize,
309
+ ...rest,
310
+ children
311
+ }
312
+ );
313
+ };
314
+ var Tab_default = Tab;
315
+ var StyledTab = styled.div`
316
+ display: inline-block;
317
+ padding: 8px 16px;
318
+ user-select: none;
319
+ font-size: ${({ fontSize }) => `${typography.fontSize[fontSize]}px`};
320
+ position: relative;
321
+ transition: border-color 0.2s ease;
322
+ cursor: pointer;
323
+
324
+ ${({ selected }) => selected && `
325
+ &::after {
326
+ content: '';
327
+ position: absolute;
328
+ bottom: -1px;
329
+ left: 0;
330
+ right: 0;
331
+ height: 3px;
332
+ background-color: ${colors.baseColors.primaryGreen};
333
+ }
334
+ `}
335
+ `;
336
+ var HelperText = styled.div`
337
+ margin-top: 4px;
338
+ font-size: ${typography.fontSize.xs}px;
339
+ color: ${({ error, warning }) => {
340
+ if (error) return colors.accents.error;
341
+ if (warning) return colors.accents.warning;
342
+ return colors.baseColors.grey3;
343
+ }};
344
+ `;
345
+ var FormField = ({
346
+ id,
347
+ label,
348
+ helperText,
349
+ error,
350
+ warning,
351
+ onInput,
352
+ onChange,
353
+ className,
354
+ ...inputProps
355
+ }) => {
356
+ const handleChange = (event) => {
357
+ if (onInput) {
358
+ onInput(event.target.value);
359
+ }
360
+ if (onChange) {
361
+ onChange(event);
362
+ }
363
+ };
364
+ const displayText = error || warning || helperText;
365
+ const hasError = !!error;
366
+ const hasWarning = !!warning && !hasError;
367
+ return /* @__PURE__ */ jsxs(FormFieldWrapper, { className, children: [
368
+ /* @__PURE__ */ jsx(Label_default, { htmlFor: id, children: label }),
369
+ /* @__PURE__ */ jsx(
370
+ Input_default,
371
+ {
372
+ id,
373
+ onChange: handleChange,
374
+ error: hasError,
375
+ warning: hasWarning,
376
+ ...inputProps
377
+ }
378
+ ),
379
+ displayText && /* @__PURE__ */ jsx(HelperText, { error: hasError, warning: hasWarning, children: displayText })
380
+ ] });
381
+ };
382
+ var FormFieldWrapper = styled.div`
383
+ display: flex;
384
+ flex-direction: column;
385
+
386
+ label {
387
+ margin-bottom: 8px;
388
+ color: ${colors.baseColors.darkBlue3};
389
+ font-size: ${typography.fontSize.m}px;
390
+ }
391
+ `;
392
+ var FormField_default = FormField;
393
+ var FormFieldTextarea = ({
394
+ id,
395
+ label,
396
+ helperText,
397
+ error,
398
+ warning,
399
+ onInput,
400
+ onChange,
401
+ className,
402
+ ...textareaProps
403
+ }) => {
404
+ const handleChange = (event) => {
405
+ if (onInput) {
406
+ onInput(event.target.value);
407
+ }
408
+ if (onChange) {
409
+ onChange(event);
410
+ }
411
+ };
412
+ const displayText = error || warning || helperText;
413
+ const hasError = !!error;
414
+ const hasWarning = !!warning && !hasError;
415
+ return /* @__PURE__ */ jsxs(FormFieldWrapper2, { className, children: [
416
+ /* @__PURE__ */ jsx(Label_default, { htmlFor: id, children: label }),
417
+ /* @__PURE__ */ jsx(
418
+ Textarea_default,
419
+ {
420
+ id,
421
+ onChange: handleChange,
422
+ error: hasError,
423
+ warning: hasWarning,
424
+ ...textareaProps
425
+ }
426
+ ),
427
+ displayText && /* @__PURE__ */ jsx(HelperText, { error: hasError, warning: hasWarning, children: displayText })
428
+ ] });
429
+ };
430
+ var FormFieldWrapper2 = styled.div`
431
+ display: flex;
432
+ flex-direction: column;
433
+
434
+ label {
435
+ margin-bottom: 8px;
436
+ color: ${colors.baseColors.darkBlue3};
437
+ font-size: ${typography.fontSize.m}px;
438
+ }
439
+ `;
440
+ var FormFieldTextarea_default = FormFieldTextarea;
441
+
442
+ export { Button_default as Button, FONT_SIZES, FONT_WEIGHTS, FormField_default as FormField, FormFieldTextarea_default as FormFieldTextarea, HelperText, Input_default as Input, Label_default as Label, Tab_default as Tab, Textarea_default as Textarea, Variant, colors, getOpacity, typography };
130
443
  //# sourceMappingURL=index.js.map
131
444
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/atoms/Spinner/Spinner.tsx","../src/atoms/Button/Button.tsx"],"names":["Variant","styled","jsx","jsxs"],"mappings":";;;;;AAYA,IAAM,IAAA,GAAO,SAAA;AAAA;AAAA;AAAA,CAAA;AAKb,IAAM,UAAU,MAAA,CAAO,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,WAAA,EAMV,CAAC,EAAE,IAAA,GAAO,EAAA,OAAS,IAAI,CAAA;AAAA,YAAA,EACtB,CAAC,EAAE,IAAA,GAAO,EAAA,OAAS,IAAI,CAAA;AAAA,eAAA,EACpB,IAAI,CAAA,CAAA,EAAI,CAAC,EAAE,KAAA,GAAQ,OAAA,OAAc,KAAK,CAAA;AAAA;AAAA;AAAA,CAAA;AAKvD,IAAM,UAAkC,CAAC;AAAA,EACvC,IAAA,GAAO,EAAA;AAAA,EACP,KAAA,GAAQ,OAAA;AAAA,EACR,OAAA,GAAU,SAAA;AAAA,EACV,OAAA,GAAU;AACZ,CAAA,qBACE,GAAA,CAAC,OAAA,EAAA,EAAQ,IAAA,EAAY,KAAA,EACnB,QAAA,kBAAA,IAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,OAAA,EAAQ,WAAA;AAAA,IACR,IAAA,EAAK,MAAA;AAAA,IACL,KAAA,EAAM,4BAAA;AAAA,IACN,IAAA,EAAK,QAAA;AAAA,IACL,YAAA,EAAW,SAAA;AAAA,IAEX,QAAA,EAAA;AAAA,sBAAA,G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,SAAS,OAAO,CAAA;AACtD,EAAA,OAAO,GAAA;AAAA,kBAAA,EACS,UAAU,CAAA;AAAA,cAAA,EACd,QAAA,GAAW,gBAAA,GAAmB,MAAA,IAAU,MAAM,CAAA;AAAA,aAAA,EAC/C,SAAS,MAAM,CAAA;AAAA,eAAA,EACb,QAAA,GAAW,MAAM,CAAC,CAAA;AAAA,cAAA,EACnB,QAAA,GAAW,gBAAgB,SAAS,CAAA;AAAA,sBAAA,EAC5B,QAAA,GAAW,SAAS,MAAM,CAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,CAAA;AAOhD,CAAC;AAAA,CAAA;AAGH,IAAM,SAAgC,CAAC;AAAA,EACrC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,GAAAA;AAAA,EAAC,YAAA;AAAA,EAAA;AAAA,IACC,KAAA,EAAO,EAAA;AAAA,IACP,UAAU,QAAA,IAAY,OAAA;AAAA,IACtB,SAAA;AAAA,IACC,GAAG,IAAA;AAAA,IAEH,oCACCA,GAAAA,CAAC,mBAAQ,CAAA,mBAETC,KAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,MAAA,IAAA,oBAAQD,GAAAA,CAAC,MAAA,EAAA,EAAM,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,MACpB;AAAA,KAAA,EACH;AAAA;AAEJ,CAAA;AAGF,IAAO,cAAA,GAAQ","file":"index.js","sourcesContent":["/** @jsxImportSource @emotion/react */\nimport React from \"react\";\nimport { keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\n\ninterface SpinnerProps {\n size?: number;\n speed?: string;\n bgColor?: string;\n fgColor?: string;\n}\n\nconst spin = keyframes`\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n`;\n\nconst Wrapper = styled.div<SpinnerProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n svg {\n width: ${({ size = 20 }) => size}px;\n height: ${({ size = 20 }) => size}px;\n animation: ${spin} ${({ speed = \"0.75s\" }) => speed} linear infinite;\n transform-origin: center;\n }\n`;\n\nconst Spinner: React.FC<SpinnerProps> = ({\n size = 20,\n speed = \"0.75s\",\n bgColor = \"#D1D5DB\",\n fgColor = \"#FFFFFF\",\n}) => (\n <Wrapper size={size} speed={speed}>\n <svg\n viewBox=\"0 0 50 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"status\"\n aria-label=\"loading\"\n >\n <circle cx=\"25\" cy=\"25\" r=\"20\" stroke={bgColor} strokeWidth=\"5\" />\n <path\n d=\"M45 25a20 20 0 0 1-20 20\"\n stroke={fgColor}\n strokeWidth=\"5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </Wrapper>\n);\n\nexport default Spinner;\n","/** @jsxImportSource @emotion/react */\nimport { css } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { ReactNode } from \"react\";\nimport Spinner from \"../Spinner/Spinner\";\n\ntype VariantName = \"primary\" | \"secondary\" | \"outline\";\n\nexport enum Variant {\n Primary = \"primary\",\n Secondary = \"secondary\",\n Outline = \"outline\",\n}\n\ninterface VariantStyle {\n background: string;\n color?: string;\n border?: string;\n}\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n variant?: VariantName;\n disabled?: boolean;\n selected?: boolean;\n icon?: ReactNode;\n loading?: boolean;\n className?: string;\n}\n\nconst VARIANTS: Record<VariantName, VariantStyle> = {\n primary: {\n background: \"linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)\",\n color: \"#FFF\",\n },\n secondary: {\n background: \"#6D65DA\",\n color: \"#FFF\",\n },\n outline: {\n background: \"transparent\",\n border: \"1px solid rgba(70, 70, 74, 0.10)\",\n color: \"#0E1116D9\",\n },\n};\n\nconst StyledButton = styled.button<ButtonProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n border-radius: 100px;\n font-weight: 500;\n font-family: \"ABCFavoritExtended\", sans-serif;\n transition: all 0.2s ease;\n width: 100%;\n max-width: 336px;\n\n span {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n }\n\n ${({ variant = \"primary\", disabled, selected }) => {\n const { background, color, border } = VARIANTS[variant];\n return css`\n background: ${background};\n border: ${selected ? \"2px solid #FFF\" : border || \"none\"};\n color: ${color || \"#FFF\"};\n opacity: ${disabled ? 0.5 : 1};\n cursor: ${disabled ? \"not-allowed\" : \"pointer\"};\n pointer-events: ${disabled ? \"none\" : \"auto\"};\n\n &:focus-visible {\n outline: 2px solid #0070f3;\n outline-offset: 2px;\n }\n `;\n }}\n`;\n\nconst Button: React.FC<ButtonProps> = ({\n label,\n icon,\n loading,\n disabled,\n className,\n ...rest\n}) => (\n <StyledButton\n label={\"\"}\n disabled={disabled || loading}\n className={className}\n {...rest}\n >\n {loading ? (\n <Spinner />\n ) : (\n <>\n {icon && <span>{icon}</span>}\n {label}\n </>\n )}\n </StyledButton>\n);\n\nexport default Button;\n"]}
1
+ {"version":3,"sources":["../src/atoms/Spinner/Spinner.tsx","../src/tokens/colors.ts","../src/tokens/typography.ts","../src/atoms/Button/Button.tsx","../src/utils/colorHelpers.ts","../src/atoms/shared/inputStyles.ts","../src/atoms/Input/Input.tsx","../src/atoms/Label/Label.tsx","../src/atoms/Textarea/Textarea.tsx","../src/atoms/Tab/Tab.tsx","../src/atoms/HelperText/HelperText.tsx","../src/molecules/FormField/FormField.tsx","../src/molecules/FormFieldTextarea/FormFieldTextarea.tsx"],"names":["Variant","styled","jsx","jsxs","css","FormFieldWrapper"],"mappings":";;;;;AAYA,IAAM,IAAA,GAAO,SAAA;AAAA;AAAA;AAAA,CAAA;AAKb,IAAM,UAAU,MAAA,CAAO,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,WAAA,EAMV,CAAC,EAAE,IAAA,GAAO,EAAA,OAAS,IAAI,CAAA;AAAA,YAAA,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IAAO,yBAAA,GAAQ","file":"index.js","sourcesContent":["/** @jsxImportSource @emotion/react */\nimport React from \"react\";\nimport { keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\n\ninterface SpinnerProps {\n size?: number;\n speed?: string;\n bgColor?: string;\n fgColor?: string;\n}\n\nconst spin = keyframes`\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n`;\n\nconst Wrapper = styled.div<SpinnerProps>`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n svg {\n width: ${({ size = 20 }) => size}px;\n height: ${({ size = 20 }) => size}px;\n animation: ${spin} ${({ speed = \"0.75s\" }) => speed} linear infinite;\n transform-origin: center;\n }\n`;\n\nconst Spinner: React.FC<SpinnerProps> = ({\n size = 20,\n speed = \"0.75s\",\n bgColor = \"#D1D5DB\",\n fgColor = \"#FFFFFF\",\n}) => (\n <Wrapper size={size} speed={speed}>\n <svg\n viewBox=\"0 0 50 50\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role=\"status\"\n aria-label=\"loading\"\n >\n <circle cx=\"25\" cy=\"25\" r=\"20\" stroke={bgColor} strokeWidth=\"5\" />\n <path\n d=\"M45 25a20 20 0 0 1-20 20\"\n stroke={fgColor}\n strokeWidth=\"5\"\n strokeLinecap=\"round\"\n />\n </svg>\n </Wrapper>\n);\n\nexport default Spinner;\n","/**\n * Color tokens for the design system\n */\n\nexport const colors = {\n // Brand colors\n baseColors: {\n // Brand\n primaryGreen: \"#7EE896\",\n primaryPurple: \"#6D65DA\",\n\n // Palette\n darkBlue1: \"#12131B\",\n darkBlue2: \"#2A2B33\",\n darkBlue3: \"#02061D\",\n\n grey1: \"#3C3C44\",\n grey2: \"#45454F\",\n grey3: \"#9CA3AF\",\n grey4: \"#8E8E98\",\n grey5: \"#4B4B4B\",\n grey6: \"#353535\",\n grey7: \"#ECECED\",\n\n white1: \"#ffffff\",\n },\n\n // Hover states\n hoverColors: {\n primaryPurple: \"#5F56D6\",\n },\n\n // Background colors\n backgrounds: {\n light1: \"#F5F6F8\",\n light2: \"#EFF1F8\",\n transparent: \"transparent\",\n },\n\n // Accents (errors, warnings, etc.)\n accents: {\n error: \"#F2545B\",\n danger: \"#D25E4A\",\n warning: \"#ECAC4D\",\n },\n\n // Gradients\n gradients: {\n gradient1: \"linear-gradient(90deg, #6D65DA 0.08%, #55A3BD 68.44%)\",\n },\n} as const;\n\nexport type Colors = typeof colors;\n\n","export type Typography = typeof typography;\n\nexport type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];\nexport type FontSize = (typeof FONT_SIZES)[keyof typeof FONT_SIZES];\nexport type Align = \"left\" | \"center\" | \"right\";\n/**\n * Typography tokens for the design system\n */\n\nexport const FONT_WEIGHTS = {\n light: 300,\n regular: 350,\n normal: 400,\n medium: 500,\n bold: 700,\n} as const;\n\nexport const FONT_SIZES = {\n xxs: 10,\n xs: 12,\n s: 13,\n m: 14,\n base: 16,\n lg: 18,\n xl: 20,\n \"2xl\": 24,\n} as const;\n\nexport const typography = {\n fontFamily: {\n primary: '\"ABCFavoritExtended\", sans-serif',\n },\n\n fontWeight: FONT_WEIGHTS,\n\n fontSize: FONT_SIZES,\n\n lineHeight: {\n tight: 1.2,\n normal: 1.5,\n relaxed: 1.75,\n },\n} as const;\n\n","/** @jsxImportSource @emotion/react */\nimport { css } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { ReactNode } from \"react\";\nimport Spinner from \"../Spinner/Spinner\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\ntype VariantName = \"primary\" | \"secondary\" | \"outline\";\n\nexport enum Variant {\n Primary = \"primary\",\n Secondary = \"secondary\",\n Outline = \"outline\",\n}\n\ninterface VariantStyle {\n background: string;\n color?: string;\n border?: string;\n}\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n label: string;\n variant?: VariantName;\n disabled?: boolean;\n selected?: boolean;\n icon?: ReactNode;\n loading?: boolean;\n className?: string;\n}\n\nconst VARIANTS: Record<VariantName, VariantStyle> = {\n primary: {\n background: colors.gradients.gradient1,\n color: colors.baseColors.white1,\n },\n secondary: {\n background: colors.baseColors.primaryPurple,\n color: colors.baseColors.white1,\n },\n outline: {\n background: colors.backgrounds.transparent,\n border: \"1px solid rgba(70, 70, 74, 0.10)\",\n color: \"#0E1116D9\",\n },\n};\n\nconst StyledButton = styled.button<ButtonProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n border-radius: 100px;\n font-weight: ${typography.fontWeight.medium};\n font-family: ${typography.fontFamily.primary};\n transition: all 0.2s ease;\n width: 100%;\n max-width: 336px;\n\n span {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n }\n\n ${({ variant = \"primary\", disabled, selected }) => {\n const { background, color, border } = VARIANTS[variant];\n return css`\n background: ${background};\n border: ${selected ? `2px solid ${colors.baseColors.white1}` : border || \"none\"};\n color: ${color || colors.baseColors.white1};\n opacity: ${disabled ? 0.5 : 1};\n cursor: ${disabled ? \"not-allowed\" : \"pointer\"};\n pointer-events: ${disabled ? \"none\" : \"auto\"};\n\n &:focus-visible {\n outline: 2px solid #0070f3;\n outline-offset: 2px;\n }\n `;\n }}\n`;\n\nconst Button: React.FC<ButtonProps> = ({\n label,\n icon,\n loading,\n disabled,\n className,\n ...rest\n}) => (\n <StyledButton\n label={\"\"}\n disabled={disabled || loading}\n className={className}\n {...rest}\n >\n {loading ? (\n <Spinner />\n ) : (\n <>\n {icon && <span>{icon}</span>}\n {label}\n </>\n )}\n </StyledButton>\n);\n\nexport default Button;\n","/**\n * Color utility functions for the design system\n */\n\nexport type TOpacity = number; // 0-100\nexport type TColor = string; // Hex color with alpha channel\n\n/**\n * Converts a hex color to a hex color with alpha channel\n * @param hexColor - Hex color string (e.g., \"#6D65DA\" or \"6D65DA\")\n * @param opacity - Opacity value from 0-100\n * @returns Hex color with alpha channel (e.g., \"#6D65DAB3\" for 70% opacity)\n * @throws Error if hex color is invalid\n */\nexport function getOpacity(hexColor: string, opacity: TOpacity): TColor {\n const hex = hexColor.trim().replace(/^#/, \"\");\n \n if (!/^[\\da-fA-F]{6}$/.test(hex)) {\n throw new Error(`Invalid hex color: ${hexColor}`);\n }\n\n const opacityFraction = Math.round((opacity / 100) * 255);\n const alphaHex = opacityFraction.toString(16).padStart(2, \"0\");\n\n return `#${hex}${alphaHex}`;\n}\n\n","import { css } from \"@emotion/react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\nimport { getOpacity } from \"../../utils/colorHelpers\";\n\nexport const defaultPadding = \"9px 17px\";\nexport const focusedPadding = \"8px 16px\";\n\nexport const baseInputStyles = css`\n border-radius: 10px;\n border: 1px solid ${colors.baseColors.grey7};\n padding: ${defaultPadding};\n color: ${getOpacity(colors.baseColors.darkBlue3, 80)};\n background-color: ${colors.baseColors.white1};\n font-weight: ${typography.fontWeight.regular};\n cursor: text;\n transition: border-color 0.2s ease;\n box-sizing: border-box;\n\n &::placeholder {\n color: ${colors.baseColors.grey3};\n }\n\n &:hover:not(:disabled) {\n cursor: text;\n }\n\n &:focus {\n outline: none;\n border-width: 2px;\n border-color: ${colors.baseColors.primaryPurple};\n padding: ${focusedPadding};\n }\n\n &:disabled {\n background-color: ${colors.baseColors.grey7};\n cursor: not-allowed;\n }\n`;\n\nexport const errorStyles = css`\n border-width: 2px;\n border-color: ${colors.accents.error};\n padding: ${focusedPadding};\n\n &:focus {\n border-width: 2px;\n border-color: ${colors.accents.error};\n padding: ${focusedPadding};\n }\n`;\n\nexport const warningStyles = css`\n border-width: 2px;\n border-color: ${colors.accents.warning};\n padding: ${focusedPadding};\n\n &:focus {\n border-width: 2px;\n border-color: ${colors.accents.warning};\n padding: ${focusedPadding};\n }\n`;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { baseInputStyles, errorStyles, warningStyles } from \"../shared/inputStyles\";\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n error?: boolean;\n warning?: boolean;\n}\n\nconst Input: React.FC<InputProps> = ({ className, error, warning, ...rest }) => {\n return <StyledInput className={className} error={error} warning={warning} {...rest} />;\n};\n\nexport default Input;\n\nconst StyledInput = styled.input<InputProps>`\n ${baseInputStyles}\n\n ${({ error }) => error && errorStyles}\n ${({ warning }) => warning && warningStyles}\n`;","import React from \"react\";\n\nexport interface LabelProps\n extends React.LabelHTMLAttributes<HTMLLabelElement> {\n className?: string;\n htmlFor?: string;\n}\n\nconst Label: React.FC<LabelProps> = ({ className, htmlFor, children, ...rest }) => {\n return (\n <label className={className} htmlFor={htmlFor} {...rest}>\n {children}\n </label>\n );\n};\n\nexport default Label;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { baseInputStyles, errorStyles, warningStyles } from \"../shared/inputStyles\";\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {\n className?: string;\n error?: boolean;\n warning?: boolean;\n}\n\nconst Textarea: React.FC<TextareaProps> = ({ className, error, warning, ...rest }) => {\n return <StyledTextarea className={className} error={error} warning={warning} {...rest} />;\n};\n\nexport default Textarea;\n\nconst StyledTextarea = styled.textarea<TextareaProps>`\n ${baseInputStyles}\n resize: vertical;\n min-height: 80px;\n font-family: inherit;\n\n ${({ error }) => error && errorStyles}\n ${({ warning }) => warning && warningStyles}\n`;\n\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography, FONT_SIZES } from \"../../tokens/typography\";\n\ntype FontSizeKey = keyof typeof FONT_SIZES;\n\nexport interface TabProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"fontSize\"> {\n children: React.ReactNode;\n selected?: boolean;\n fontSize?: FontSizeKey;\n className?: string;\n}\n\ninterface StyledTabProps {\n selected?: boolean;\n fontSize: FontSizeKey;\n}\n\nconst Tab: React.FC<TabProps> = ({\n children,\n selected,\n fontSize = \"m\",\n className,\n ...rest\n}) => {\n return (\n <StyledTab\n className={className}\n selected={selected}\n fontSize={fontSize}\n {...rest}\n >\n {children}\n </StyledTab>\n );\n};\n\nexport default Tab;\n\nconst StyledTab = styled.div<StyledTabProps>`\n display: inline-block;\n padding: 8px 16px;\n user-select: none;\n font-size: ${({ fontSize }) => `${typography.fontSize[fontSize]}px`};\n position: relative;\n transition: border-color 0.2s ease;\n cursor: pointer;\n\n ${({ selected }) =>\n selected &&\n `\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n right: 0;\n height: 3px;\n background-color: ${colors.baseColors.primaryGreen};\n }\n `}\n`;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface HelperTextProps {\n error?: boolean;\n warning?: boolean;\n children: React.ReactNode;\n}\n\nexport const HelperText = styled.div<HelperTextProps>`\n margin-top: 4px;\n font-size: ${typography.fontSize.xs}px;\n color: ${({ error, warning }) => {\n if (error) return colors.accents.error;\n if (warning) return colors.accents.warning;\n return colors.baseColors.grey3;\n }};\n`;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport Input, { InputProps } from \"../../atoms/Input\";\nimport Label from \"../../atoms/Label\";\nimport { HelperText } from \"../../atoms/HelperText\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface FormFieldProps extends Omit<InputProps, \"id\" | \"onInput\" | \"error\" | \"warning\"> {\n id: string;\n label: string;\n helperText?: string;\n error?: string;\n warning?: string;\n onInput?: (value: string) => void;\n onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nconst FormField: React.FC<FormFieldProps> = ({\n id,\n label,\n helperText,\n error,\n warning,\n onInput,\n onChange,\n className,\n ...inputProps\n}) => {\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onInput) {\n onInput(event.target.value);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n const displayText = error || warning || helperText;\n const hasError = !!error;\n const hasWarning = !!warning && !hasError;\n\n return (\n <FormFieldWrapper className={className}>\n <Label htmlFor={id}>{label}</Label>\n <Input\n id={id}\n onChange={handleChange}\n error={hasError}\n warning={hasWarning}\n {...inputProps}\n />\n {displayText && (\n <HelperText error={hasError} warning={hasWarning}>\n {displayText}\n </HelperText>\n )}\n </FormFieldWrapper>\n );\n};\n\nconst FormFieldWrapper = styled.div`\n display: flex;\n flex-direction: column;\n \n label {\n margin-bottom: 8px;\n color: ${colors.baseColors.darkBlue3};\n font-size: ${typography.fontSize.m}px;\n }\n`;\n\nexport default FormField;\n\n","import React from \"react\";\nimport styled from \"@emotion/styled\";\nimport Textarea, { TextareaProps } from \"../../atoms/Textarea\";\nimport Label from \"../../atoms/Label\";\nimport { HelperText } from \"../../atoms/HelperText\";\nimport { colors } from \"../../tokens/colors\";\nimport { typography } from \"../../tokens/typography\";\n\nexport interface FormFieldTextareaProps extends Omit<TextareaProps, \"id\" | \"onInput\" | \"error\" | \"warning\"> {\n id: string;\n label: string;\n helperText?: string;\n error?: string;\n warning?: string;\n onInput?: (value: string) => void;\n onChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n}\n\nconst FormFieldTextarea: React.FC<FormFieldTextareaProps> = ({\n id,\n label,\n helperText,\n error,\n warning,\n onInput,\n onChange,\n className,\n ...textareaProps\n}) => {\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n if (onInput) {\n onInput(event.target.value);\n }\n if (onChange) {\n onChange(event);\n }\n };\n\n const displayText = error || warning || helperText;\n const hasError = !!error;\n const hasWarning = !!warning && !hasError;\n\n return (\n <FormFieldWrapper className={className}>\n <Label htmlFor={id}>{label}</Label>\n <Textarea\n id={id}\n onChange={handleChange}\n error={hasError}\n warning={hasWarning}\n {...textareaProps}\n />\n {displayText && (\n <HelperText error={hasError} warning={hasWarning}>\n {displayText}\n </HelperText>\n )}\n </FormFieldWrapper>\n );\n};\n\nconst FormFieldWrapper = styled.div`\n display: flex;\n flex-direction: column;\n \n label {\n margin-bottom: 8px;\n color: ${colors.baseColors.darkBlue3};\n font-size: ${typography.fontSize.m}px;\n }\n`;\n\nexport default FormFieldTextarea;\n\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ndcloud-storybook",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "type": "module",