@uniai-fe/uds-foundation 0.0.7 → 0.0.9

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/index.css +10 -77
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +1 -0
  4. package/dist/provider/ThemeProvider.d.ts +13 -0
  5. package/dist/provider/ThemeProvider.js +14 -0
  6. package/dist/provider/index.d.ts +3 -0
  7. package/dist/provider/index.js +4 -0
  8. package/package.json +12 -2
  9. package/src/color/index.scss +7 -2
  10. package/src/color/primitives.scss +205 -207
  11. package/src/color/semantic/background.scss +5 -12
  12. package/src/color/semantic/border.scss +7 -14
  13. package/src/color/semantic/core.scss +13 -20
  14. package/src/color/semantic/feedback.scss +7 -14
  15. package/src/color/semantic/index.scss +17 -7
  16. package/src/color/semantic/interaction.scss +3 -10
  17. package/src/color/semantic/label.scss +7 -14
  18. package/src/color/semantic/surface.scss +8 -15
  19. package/src/index.scss +53 -16
  20. package/src/index.ts +1 -0
  21. package/src/init/document.scss +2 -2
  22. package/src/init/reset.scss +6 -4
  23. package/src/layout/breakpoint.scss +5 -7
  24. package/src/layout/radius.scss +28 -30
  25. package/src/layout/size.scss +16 -18
  26. package/src/provider/ThemeProvider.tsx +23 -0
  27. package/src/provider/index.ts +2 -0
  28. package/src/spacing/gap.scss +16 -18
  29. package/src/spacing/padding.scss +12 -14
  30. package/src/typography/fonts/font-face.scss +1 -1
  31. package/src/typography/fonts/font-family.scss +1 -1
  32. package/src/typography/styles/body.scss +22 -24
  33. package/src/typography/styles/caption.scss +9 -11
  34. package/src/typography/styles/display.scss +13 -15
  35. package/src/typography/styles/heading.scss +25 -27
  36. package/src/typography/styles/label.scss +13 -15
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- @layer theme.init {
2
+ @layer foundation.reset {
3
3
  :root {
4
4
  -webkit-tap-highlight-color: transparent;
5
5
  -webkit-text-size-adjust: none;
@@ -27,14 +27,16 @@
27
27
  *:focus-visible {
28
28
  outline: none;
29
29
  }
30
- html {
30
+ html,
31
+ .uds-theme-root {
31
32
  width: 100%;
32
33
  font-size: 10px;
33
34
  font-family: var(--font-family-sans);
34
35
  background-color: #fff;
35
36
  touch-action: manipulation;
36
37
  }
37
- body {
38
+ body,
39
+ .uds-theme-root {
38
40
  width: 100%;
39
41
  position: relative;
40
42
  background: none;
@@ -287,8 +289,6 @@
287
289
  font-size: 1vw;
288
290
  }
289
291
  }
290
- }
291
- @layer theme.init {
292
292
  html,
293
293
  body {
294
294
  width: 100%;
@@ -300,7 +300,7 @@
300
300
  z-index: 0;
301
301
  }
302
302
  }
303
- @layer theme.tokens.color {
303
+ @layer foundation.color {
304
304
  :root {
305
305
  --color-common-100: #fff;
306
306
  --color-common-0: #000;
@@ -491,11 +491,6 @@
491
491
  --color-cyan-90: #ccfbff;
492
492
  --color-cyan-95: #e5fdff;
493
493
  --color-cyan-99: #faffff;
494
- }
495
- }
496
- @layer theme.tokens.color {
497
- :root,
498
- .theme-light {
499
494
  --color-primary-default: var(--color-blue-55);
500
495
  --color-primary-strong: var(--color-blue-45);
501
496
  --color-primary-heavy: var(--color-blue-30);
@@ -505,42 +500,22 @@
505
500
  --color-tertiary-default: var(--color-cool-gray-95);
506
501
  --color-tertiary-strong: var(--color-cool-gray-90);
507
502
  --color-tertiary-heavy: var(--color-cool-gray-80);
508
- }
509
- }
510
- @layer theme.tokens.color {
511
- :root,
512
- .theme-light {
513
503
  --color-label-strong: var(--color-cool-gray-10);
514
504
  --color-label-standard: var(--color-cool-gray-20);
515
505
  --color-label-neutral: var(--color-cool-gray-50);
516
506
  --color-label-alternative: var(--color-cool-gray-70);
517
507
  --color-label-assistive: var(--color-cool-gray-80);
518
508
  --color-label-disabled: var(--color-cool-gray-80);
519
- }
520
- }
521
- @layer theme.tokens.color {
522
- :root,
523
- .theme-light {
524
509
  --color-border-standard-cool-gray: var(--color-cool-gray-90);
525
510
  --color-border-standard-blue: var(--color-blue-90);
526
511
  --color-border-standard-strong: var(--color-cool-gray-75);
527
512
  --color-border-standard-heavy: var(--color-cool-gray-20);
528
513
  --color-border-standard-alternative: var(--color-cool-gray-80);
529
514
  --color-border-standard-assistive: var(--color-cool-gray-90);
530
- }
531
- }
532
- @layer theme.tokens.color {
533
- :root,
534
- .theme-light {
535
515
  --color-bg-standard-cool-gray: var(--color-cool-gray-99);
536
516
  --color-bg-alternative-cool-gray: var(--color-cool-gray-95);
537
517
  --color-bg-standard-neutral: var(--color-neutral-99);
538
518
  --color-bg-alternative-neutral: var(--color-neutral-95);
539
- }
540
- }
541
- @layer theme.tokens.color {
542
- :root,
543
- .theme-light {
544
519
  --color-bg-surface-static-white: var(--color-common-100);
545
520
  --color-bg-surface-static-cool-gray: var(--color-cool-gray-99);
546
521
  --color-bg-surface-static-blue: var(--color-blue-95);
@@ -548,18 +523,8 @@
548
523
  --color-bg-surface-standard: var(--color-cool-gray-95);
549
524
  --color-bg-surface-strong: var(--color-neutral-80);
550
525
  --color-bg-surface-heavy: var(--color-cool-gray-20);
551
- }
552
- }
553
- @layer theme.tokens.color {
554
- :root,
555
- .theme-light {
556
526
  --color-interaction-static: var(--color-common-100);
557
527
  --color-interaction-disabled: var(--color-cool-gray-95);
558
- }
559
- }
560
- @layer theme.tokens.color {
561
- :root,
562
- .theme-light {
563
528
  --color-danger: var(--color-red-40);
564
529
  --color-error: var(--color-red-45);
565
530
  --color-warning: var(--color-yellow-50);
@@ -568,7 +533,7 @@
568
533
  --color-new: var(--color-red-50);
569
534
  }
570
535
  }
571
- @layer theme.tokens.spacing {
536
+ @layer foundation.spacing {
572
537
  :root {
573
538
  --spacing-padding-1: 2px;
574
539
  --spacing-padding-2: 4px;
@@ -581,10 +546,6 @@
581
546
  --spacing-padding-9: 28px;
582
547
  --spacing-padding-10: 32px;
583
548
  --spacing-padding-11: 40px;
584
- }
585
- }
586
- @layer theme.tokens.spacing {
587
- :root {
588
549
  --spacing-gap-1: 2px;
589
550
  --spacing-gap-2: 4px;
590
551
  --spacing-gap-3: 6px;
@@ -602,16 +563,12 @@
602
563
  --spacing-gap-15: 80px;
603
564
  }
604
565
  }
605
- @layer theme.tokens.layout {
566
+ @layer foundation.layout {
606
567
  :root {
607
568
  --theme-breakpoint-xsmall-start: 0px;
608
569
  --theme-breakpoint-small-start: 768px;
609
570
  --theme-breakpoint-medium-start: 992px;
610
571
  --theme-breakpoint-large-start: 1200px;
611
- }
612
- }
613
- @layer theme.tokens.layout {
614
- :root {
615
572
  --theme-size-xxsmall: 4px;
616
573
  --theme-size-xsmall-1: 8px;
617
574
  --theme-size-xsmall-2: 12px;
@@ -627,10 +584,6 @@
627
584
  --theme-size-large-2: 80px;
628
585
  --theme-size-xlarge-1: 96px;
629
586
  --theme-size-xlarge-2: 120px;
630
- }
631
- }
632
- @layer theme.tokens.layout {
633
- :root {
634
587
  --theme-radius-4x4: 1px;
635
588
  --theme-radius-8x8: 2px;
636
589
  --theme-radius-12x12: 2px;
@@ -658,7 +611,7 @@
658
611
  --theme-radius-xlarge: 16px;
659
612
  }
660
613
  }
661
- @layer theme.tokens.typography {
614
+ @layer foundation.typography {
662
615
  @font-face {
663
616
  font-family: "Pretendard JP Variable";
664
617
  src: url("./fonts/pretendard-jp/PretendardJPVariable.woff2") format("woff2");
@@ -673,9 +626,7 @@
673
626
  font-style: normal;
674
627
  font-display: swap;
675
628
  }
676
- }
677
- @layer theme.tokens.typography {
678
- :root {
629
+ :root :root {
679
630
  --font-family-pretendard:
680
631
  "Pretendard JP Variable", "Pretendard JP", "Pretendard Variable",
681
632
  "Pretendard", "InterVariable", "Inter", "Noto Sans KR", "-apple-system",
@@ -697,8 +648,6 @@
697
648
  "Oxygen", "Oxygen-Sans", "Ubuntu", "Cantarell", "sans-serif";
698
649
  --font-family-sans: var(--font-family-pretendard);
699
650
  }
700
- }
701
- @layer theme.tokens.typography {
702
651
  :root {
703
652
  --font-display-large-size: 60px;
704
653
  --font-display-large-line-height: 1.4em;
@@ -712,10 +661,6 @@
712
661
  --font-display-small-line-height: 1.4em;
713
662
  --font-display-small-letter-spacing: -0.2px;
714
663
  --font-display-small-weight: 600;
715
- }
716
- }
717
- @layer theme.tokens.typography {
718
- :root {
719
664
  --font-heading-xlarge-size: 40px;
720
665
  --font-heading-xlarge-line-height: 1.4em;
721
666
  --font-heading-xlarge-letter-spacing: -0.2px;
@@ -740,10 +685,6 @@
740
685
  --font-heading-xxsmall-line-height: 1.5em;
741
686
  --font-heading-xxsmall-letter-spacing: 0px;
742
687
  --font-heading-xxsmall-weight: 600;
743
- }
744
- }
745
- @layer theme.tokens.typography {
746
- :root {
747
688
  --font-body-large-size: 19px;
748
689
  --font-body-large-line-height: 1.5em;
749
690
  --font-body-large-letter-spacing: 0px;
@@ -764,10 +705,6 @@
764
705
  --font-body-xxsmall-line-height: 1.5em;
765
706
  --font-body-xxsmall-letter-spacing: 0px;
766
707
  --font-body-xxsmall-weight: 400;
767
- }
768
- }
769
- @layer theme.tokens.typography {
770
- :root {
771
708
  --font-label-large-size: 16px;
772
709
  --font-label-large-line-height: 1.5em;
773
710
  --font-label-large-letter-spacing: 0px;
@@ -780,10 +717,6 @@
780
717
  --font-label-small-line-height: 1.5em;
781
718
  --font-label-small-letter-spacing: 0px;
782
719
  --font-label-small-weight: 500;
783
- }
784
- }
785
- @layer theme.tokens.typography {
786
- :root {
787
720
  --font-caption-large-size: 12px;
788
721
  --font-caption-large-line-height: 1.5em;
789
722
  --font-caption-large-letter-spacing: 0px;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export { NextLocalFontOptions, ThemeFontDefinition, ThemeFontDisplay, ThemeFontSource, ThemeFontStyle, createLocalFontOptions } from './typography/fonts/types.js';
2
2
  export { pretendardFont, pretendardLocalFont } from './typography/fonts/pretendard.js';
3
3
  export { interFont, interLocalFont } from './typography/fonts/inter.js';
4
+ export { ThemeProvider, FoundationThemeProviderProps as ThemeProviderProps } from './provider/ThemeProvider.js';
5
+ import 'react/jsx-runtime';
6
+ import 'react';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  import "./index.scss";
2
2
  export * from "./typography/fonts";
3
+ export * from "./provider";
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ type FoundationThemeProviderProps = {
5
+ className?: string;
6
+ };
7
+ /**
8
+ * Foundation Theme Provider — `.uds-theme-root` 클래스를 부여해
9
+ * CSS 변수 토큰이 적용될 루트를 명시한다.
10
+ */
11
+ declare function ThemeProvider({ children, className, }: PropsWithChildren<FoundationThemeProviderProps>): react_jsx_runtime.JSX.Element;
12
+
13
+ export { type FoundationThemeProviderProps, ThemeProvider };
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ function ThemeProvider({
3
+ children,
4
+ className
5
+ }) {
6
+ const classNames = ["uds-theme-root"];
7
+ if (className) {
8
+ classNames.push(className);
9
+ }
10
+ return /* @__PURE__ */ jsx("div", { className: classNames.join(" "), children });
11
+ }
12
+ export {
13
+ ThemeProvider
14
+ };
@@ -0,0 +1,3 @@
1
+ export { ThemeProvider, FoundationThemeProviderProps as ThemeProviderProps } from './ThemeProvider.js';
2
+ import 'react/jsx-runtime';
3
+ import 'react';
@@ -0,0 +1,4 @@
1
+ import { ThemeProvider } from "./ThemeProvider";
2
+ export {
3
+ ThemeProvider
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-foundation",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "UNIAI Design System; Design Foundation Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -12,7 +12,7 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "packageManager": "pnpm@10.26.1",
15
+ "packageManager": "pnpm@10.26.2",
16
16
  "engines": {
17
17
  "node": ">=24",
18
18
  "pnpm": ">=10"
@@ -22,6 +22,9 @@
22
22
  "email": "yth4135@naver.com",
23
23
  "url": "https://github.com/GraffitoRyu"
24
24
  },
25
+ "peerDependencies": {
26
+ "react": ">=19"
27
+ },
25
28
  "files": [
26
29
  "dist",
27
30
  "src",
@@ -66,6 +69,11 @@
66
69
  "import": "./dist/helpers/index.js",
67
70
  "default": "./dist/helpers/index.js"
68
71
  },
72
+ "./provider": {
73
+ "types": "./dist/provider/index.d.ts",
74
+ "import": "./dist/provider/index.js",
75
+ "default": "./dist/provider/index.js"
76
+ },
69
77
  "./types/theme-tokens": {
70
78
  "types": "./dist/types/theme-tokens.d.ts",
71
79
  "import": "./dist/types/theme-tokens.js",
@@ -92,6 +100,8 @@
92
100
  },
93
101
  "devDependencies": {
94
102
  "@types/node": "^24.10.2",
103
+ "@types/react": "^19.2.7",
104
+ "react": "^19.2.0",
95
105
  "@uniai-fe/tsconfig": "workspace:*",
96
106
  "autoprefixer": "^10.4.23",
97
107
  "postcss": "^8.5.6",
@@ -1,2 +1,7 @@
1
- @use "./primitives.scss";
2
- @use "./semantic/index.scss";
1
+ @use "./primitives.scss" as colorPrimitives;
2
+ @use "./semantic/index.scss" as colorSemantic;
3
+
4
+ @mixin foundation-color-tokens() {
5
+ @include colorPrimitives.foundation-color-primitives();
6
+ @include colorSemantic.foundation-color-semantic();
7
+ }