@react-xp/design-system 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/dist/cjs/helpers/a11y.js +176 -0
  4. package/dist/cjs/helpers/index.js +18 -0
  5. package/dist/cjs/helpers/styles.js +172 -0
  6. package/dist/cjs/index.js +19 -0
  7. package/dist/cjs/styles/avatars.js +63 -0
  8. package/dist/cjs/styles/badges.js +59 -0
  9. package/dist/cjs/styles/bottomSheets.js +76 -0
  10. package/dist/cjs/styles/buttons.js +129 -0
  11. package/dist/cjs/styles/cards.js +71 -0
  12. package/dist/cjs/styles/checkboxes.js +70 -0
  13. package/dist/cjs/styles/chips.js +98 -0
  14. package/dist/cjs/styles/datePickers.js +113 -0
  15. package/dist/cjs/styles/dividers.js +12 -0
  16. package/dist/cjs/styles/emptyStates.js +40 -0
  17. package/dist/cjs/styles/forms.js +32 -0
  18. package/dist/cjs/styles/headers.js +46 -0
  19. package/dist/cjs/styles/index.js +43 -0
  20. package/dist/cjs/styles/inputs.js +101 -0
  21. package/dist/cjs/styles/listItems.js +65 -0
  22. package/dist/cjs/styles/modals.js +92 -0
  23. package/dist/cjs/styles/pagination.js +39 -0
  24. package/dist/cjs/styles/popovers.js +64 -0
  25. package/dist/cjs/styles/progress.js +33 -0
  26. package/dist/cjs/styles/radios.js +70 -0
  27. package/dist/cjs/styles/selects.js +137 -0
  28. package/dist/cjs/styles/skeletons.js +34 -0
  29. package/dist/cjs/styles/steppers.js +71 -0
  30. package/dist/cjs/styles/switches.js +76 -0
  31. package/dist/cjs/styles/tables.js +57 -0
  32. package/dist/cjs/styles/tabs.js +71 -0
  33. package/dist/cjs/styles/toasts.js +82 -0
  34. package/dist/cjs/styles/tooltips.js +46 -0
  35. package/dist/cjs/types/index.js +18 -0
  36. package/dist/cjs/types/states.js +8 -0
  37. package/dist/cjs/types/tokens.js +18 -0
  38. package/dist/esm/helpers/a11y.js +169 -0
  39. package/dist/esm/helpers/index.js +2 -0
  40. package/dist/esm/helpers/styles.js +158 -0
  41. package/dist/esm/index.js +3 -0
  42. package/dist/esm/styles/avatars.js +59 -0
  43. package/dist/esm/styles/badges.js +55 -0
  44. package/dist/esm/styles/bottomSheets.js +72 -0
  45. package/dist/esm/styles/buttons.js +125 -0
  46. package/dist/esm/styles/cards.js +67 -0
  47. package/dist/esm/styles/checkboxes.js +66 -0
  48. package/dist/esm/styles/chips.js +94 -0
  49. package/dist/esm/styles/datePickers.js +108 -0
  50. package/dist/esm/styles/dividers.js +8 -0
  51. package/dist/esm/styles/emptyStates.js +36 -0
  52. package/dist/esm/styles/forms.js +28 -0
  53. package/dist/esm/styles/headers.js +42 -0
  54. package/dist/esm/styles/index.js +27 -0
  55. package/dist/esm/styles/inputs.js +97 -0
  56. package/dist/esm/styles/listItems.js +61 -0
  57. package/dist/esm/styles/modals.js +88 -0
  58. package/dist/esm/styles/pagination.js +35 -0
  59. package/dist/esm/styles/popovers.js +60 -0
  60. package/dist/esm/styles/progress.js +27 -0
  61. package/dist/esm/styles/radios.js +66 -0
  62. package/dist/esm/styles/selects.js +133 -0
  63. package/dist/esm/styles/skeletons.js +29 -0
  64. package/dist/esm/styles/steppers.js +66 -0
  65. package/dist/esm/styles/switches.js +72 -0
  66. package/dist/esm/styles/tables.js +53 -0
  67. package/dist/esm/styles/tabs.js +66 -0
  68. package/dist/esm/styles/toasts.js +77 -0
  69. package/dist/esm/styles/tooltips.js +42 -0
  70. package/dist/esm/types/index.js +2 -0
  71. package/dist/esm/types/states.js +3 -0
  72. package/dist/esm/types/tokens.js +12 -0
  73. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  74. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  75. package/dist/types/helpers/a11y.d.ts +20 -0
  76. package/dist/types/helpers/a11y.d.ts.map +1 -0
  77. package/dist/types/helpers/index.d.ts +3 -0
  78. package/dist/types/helpers/index.d.ts.map +1 -0
  79. package/dist/types/helpers/styles.d.ts +31 -0
  80. package/dist/types/helpers/styles.d.ts.map +1 -0
  81. package/dist/types/index.d.ts +4 -0
  82. package/dist/types/index.d.ts.map +1 -0
  83. package/dist/types/styles/avatars.d.ts +10 -0
  84. package/dist/types/styles/avatars.d.ts.map +1 -0
  85. package/dist/types/styles/badges.d.ts +8 -0
  86. package/dist/types/styles/badges.d.ts.map +1 -0
  87. package/dist/types/styles/bottomSheets.d.ts +15 -0
  88. package/dist/types/styles/bottomSheets.d.ts.map +1 -0
  89. package/dist/types/styles/buttons.d.ts +22 -0
  90. package/dist/types/styles/buttons.d.ts.map +1 -0
  91. package/dist/types/styles/cards.d.ts +18 -0
  92. package/dist/types/styles/cards.d.ts.map +1 -0
  93. package/dist/types/styles/checkboxes.d.ts +18 -0
  94. package/dist/types/styles/checkboxes.d.ts.map +1 -0
  95. package/dist/types/styles/chips.d.ts +20 -0
  96. package/dist/types/styles/chips.d.ts.map +1 -0
  97. package/dist/types/styles/datePickers.d.ts +30 -0
  98. package/dist/types/styles/datePickers.d.ts.map +1 -0
  99. package/dist/types/styles/dividers.d.ts +4 -0
  100. package/dist/types/styles/dividers.d.ts.map +1 -0
  101. package/dist/types/styles/emptyStates.d.ts +10 -0
  102. package/dist/types/styles/emptyStates.d.ts.map +1 -0
  103. package/dist/types/styles/forms.d.ts +10 -0
  104. package/dist/types/styles/forms.d.ts.map +1 -0
  105. package/dist/types/styles/headers.d.ts +11 -0
  106. package/dist/types/styles/headers.d.ts.map +1 -0
  107. package/dist/types/styles/index.d.ts +28 -0
  108. package/dist/types/styles/index.d.ts.map +1 -0
  109. package/dist/types/styles/inputs.d.ts +19 -0
  110. package/dist/types/styles/inputs.d.ts.map +1 -0
  111. package/dist/types/styles/listItems.d.ts +19 -0
  112. package/dist/types/styles/listItems.d.ts.map +1 -0
  113. package/dist/types/styles/modals.d.ts +15 -0
  114. package/dist/types/styles/modals.d.ts.map +1 -0
  115. package/dist/types/styles/pagination.d.ts +9 -0
  116. package/dist/types/styles/pagination.d.ts.map +1 -0
  117. package/dist/types/styles/popovers.d.ts +12 -0
  118. package/dist/types/styles/popovers.d.ts.map +1 -0
  119. package/dist/types/styles/progress.d.ts +11 -0
  120. package/dist/types/styles/progress.d.ts.map +1 -0
  121. package/dist/types/styles/radios.d.ts +17 -0
  122. package/dist/types/styles/radios.d.ts.map +1 -0
  123. package/dist/types/styles/selects.d.ts +25 -0
  124. package/dist/types/styles/selects.d.ts.map +1 -0
  125. package/dist/types/styles/skeletons.d.ts +13 -0
  126. package/dist/types/styles/skeletons.d.ts.map +1 -0
  127. package/dist/types/styles/steppers.d.ts +21 -0
  128. package/dist/types/styles/steppers.d.ts.map +1 -0
  129. package/dist/types/styles/switches.d.ts +17 -0
  130. package/dist/types/styles/switches.d.ts.map +1 -0
  131. package/dist/types/styles/tables.d.ts +13 -0
  132. package/dist/types/styles/tables.d.ts.map +1 -0
  133. package/dist/types/styles/tabs.d.ts +19 -0
  134. package/dist/types/styles/tabs.d.ts.map +1 -0
  135. package/dist/types/styles/toasts.d.ts +13 -0
  136. package/dist/types/styles/toasts.d.ts.map +1 -0
  137. package/dist/types/styles/tooltips.d.ts +9 -0
  138. package/dist/types/styles/tooltips.d.ts.map +1 -0
  139. package/dist/types/types/index.d.ts +3 -0
  140. package/dist/types/types/index.d.ts.map +1 -0
  141. package/dist/types/types/states.d.ts +26 -0
  142. package/dist/types/types/states.d.ts.map +1 -0
  143. package/dist/types/types/tokens.d.ts +16 -0
  144. package/dist/types/types/tokens.d.ts.map +1 -0
  145. package/package.json +73 -0
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPaginationParts = void 0;
4
+ // styles/pagination.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getPaginationParts = (t) => ({
7
+ container: {
8
+ flexDirection: 'row',
9
+ alignItems: 'center',
10
+ justifyContent: 'space-between',
11
+ gap: (0, tokens_1.tok)(t, 'space-3'),
12
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
13
+ },
14
+ pageInfo: {
15
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
16
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
17
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
18
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
19
+ },
20
+ button: {
21
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
22
+ minWidth: (0, tokens_1.tok)(t, 'tap-target-min'),
23
+ borderRadius: (0, tokens_1.tok)(t, 'radius-3'),
24
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
25
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
26
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
27
+ alignItems: 'center',
28
+ justifyContent: 'center',
29
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-3'),
30
+ },
31
+ buttonLabel: {
32
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
33
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
34
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
35
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-medium'),
36
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
37
+ },
38
+ });
39
+ exports.getPaginationParts = getPaginationParts;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPopoverParts = void 0;
4
+ // styles/popovers.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getPopoverParts = (t) => {
7
+ const m = (0, tokens_1.motion)(t, 'motion-emphasis-enter');
8
+ return {
9
+ container: {
10
+ zIndex: (0, tokens_1.tok)(t, 'z-index-layer-dropdown'),
11
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
12
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
13
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
14
+ borderRadius: (0, tokens_1.tok)(t, 'radius-4'),
15
+ shadow: (0, tokens_1.tok)(t, 'shadow-level-4'),
16
+ overflow: 'hidden',
17
+ minWidth: 240,
18
+ animationDurationMs: m.durationMs,
19
+ animationEasing: m.easing,
20
+ },
21
+ header: {
22
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
23
+ paddingTop: (0, tokens_1.tok)(t, 'space-4'),
24
+ paddingBottom: (0, tokens_1.tok)(t, 'space-2'),
25
+ borderBottomWidth: (0, tokens_1.tok)(t, 'border-width-default'),
26
+ borderBottomColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
27
+ },
28
+ body: {
29
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
30
+ paddingVertical: (0, tokens_1.tok)(t, 'space-3'),
31
+ },
32
+ footer: {
33
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
34
+ paddingTop: (0, tokens_1.tok)(t, 'space-2'),
35
+ paddingBottom: (0, tokens_1.tok)(t, 'space-4'),
36
+ borderTopWidth: (0, tokens_1.tok)(t, 'border-width-default'),
37
+ borderTopColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
38
+ },
39
+ title: {
40
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
41
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-heading'),
42
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
43
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-strong'),
44
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-tight'),
45
+ },
46
+ subtitle: {
47
+ marginTop: (0, tokens_1.tok)(t, 'space-1'),
48
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
49
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
50
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
51
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-regular'),
52
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
53
+ },
54
+ arrow: {
55
+ width: (0, tokens_1.tok)(t, 'space-2'),
56
+ height: (0, tokens_1.tok)(t, 'space-2'),
57
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
58
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
59
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
60
+ transform: 'rotate(45deg)',
61
+ },
62
+ };
63
+ };
64
+ exports.getPopoverParts = getPopoverParts;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCircularProgressStyle = exports.getLinearProgressStyle = exports.getProgressParts = void 0;
4
+ // styles/progress.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getProgressParts = (t) => ({
7
+ track: {
8
+ backgroundColor: (0, tokens_1.tok)(t, 'color-bg-subtle'),
9
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
10
+ overflow: 'hidden',
11
+ },
12
+ fill: {
13
+ backgroundColor: (0, tokens_1.tok)(t, 'color-action-primary'),
14
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
15
+ },
16
+ label: {
17
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
18
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
19
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
20
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
21
+ },
22
+ });
23
+ exports.getProgressParts = getProgressParts;
24
+ // Helpers semânticos para tamanhos
25
+ const getLinearProgressStyle = (t, heightToken = 'space-2') => ({
26
+ height: (0, tokens_1.tok)(t, heightToken),
27
+ });
28
+ exports.getLinearProgressStyle = getLinearProgressStyle;
29
+ const getCircularProgressStyle = (t, size) => ({
30
+ width: size,
31
+ height: size,
32
+ });
33
+ exports.getCircularProgressStyle = getCircularProgressStyle;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRadioParts = void 0;
4
+ // styles/radios.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getRadioParts = (t, s = {}) => {
7
+ const isOn = Boolean(s.selected);
8
+ const isDisabled = Boolean(s.disabled);
9
+ const wrapper = {
10
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
11
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
12
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-2'),
13
+ flexDirection: 'row',
14
+ alignItems: 'center',
15
+ gap: (0, tokens_1.tok)(t, 'space-2'),
16
+ };
17
+ const outerBase = {
18
+ width: (0, tokens_1.tok)(t, 'typography-font-size-5'),
19
+ height: (0, tokens_1.tok)(t, 'typography-font-size-5'),
20
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
21
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
22
+ borderColor: (0, tokens_1.tok)(t, 'color-border-strong'),
23
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ };
27
+ const outerOn = {
28
+ borderColor: (0, tokens_1.tok)(t, 'color-accent'),
29
+ };
30
+ const outerDisabled = {
31
+ borderColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
32
+ backgroundColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
33
+ };
34
+ const inner = {
35
+ width: (0, tokens_1.tok)(t, 'space-2'),
36
+ height: (0, tokens_1.tok)(t, 'space-2'),
37
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
38
+ backgroundColor: isDisabled
39
+ ? (0, tokens_1.tok)(t, 'color-state-disabled-fg')
40
+ : (0, tokens_1.tok)(t, 'color-accent'),
41
+ opacity: isOn ? 1 : 0,
42
+ };
43
+ const label = {
44
+ color: isDisabled
45
+ ? (0, tokens_1.tok)(t, 'color-state-disabled-fg')
46
+ : (0, tokens_1.tok)(t, 'color-fg-default'),
47
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
48
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
49
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
50
+ };
51
+ const focusRing = {
52
+ outlineStyle: 'solid',
53
+ outlineWidth: (0, tokens_1.tok)(t, 'border-width-focus'),
54
+ outlineColor: (0, tokens_1.tok)(t, 'color-focus-ring'),
55
+ outlineOffset: (0, tokens_1.tok)(t, 'focus-ring-gap'),
56
+ };
57
+ const interaction = s.pressed
58
+ ? { opacity: (0, tokens_1.tok)(t, 'opacity-pressed') }
59
+ : s.hovered
60
+ ? { opacity: 0.96 }
61
+ : {};
62
+ return {
63
+ wrapper: (0, tokens_1.merge)(wrapper, interaction),
64
+ outer: (0, tokens_1.merge)(outerBase, isOn && outerOn, isDisabled && outerDisabled),
65
+ inner: (0, tokens_1.merge)(inner),
66
+ label: (0, tokens_1.merge)(label),
67
+ focusRing: (0, tokens_1.merge)(s.focusVisible ? focusRing : undefined),
68
+ };
69
+ };
70
+ exports.getRadioParts = getRadioParts;
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSelectParts = void 0;
4
+ // styles/selects.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const sizeStyles = (t) => ({
7
+ sm: {
8
+ trigger: {
9
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
10
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-3'),
11
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
12
+ },
13
+ valueText: { fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2') },
14
+ },
15
+ md: {
16
+ trigger: {
17
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
18
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
19
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
20
+ },
21
+ valueText: { fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3') },
22
+ },
23
+ lg: {
24
+ trigger: {
25
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
26
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-5'),
27
+ paddingVertical: (0, tokens_1.tok)(t, 'space-3'),
28
+ },
29
+ valueText: { fontSize: (0, tokens_1.tok)(t, 'typography-font-size-4') },
30
+ },
31
+ });
32
+ const getSelectParts = (t, opts = {}) => {
33
+ const size = opts.size ?? 'md';
34
+ const isDisabled = Boolean(opts.disabled);
35
+ const isError = Boolean(opts.error);
36
+ const isFocused = Boolean(opts.focused);
37
+ const isOpen = Boolean(opts.open);
38
+ const s = sizeStyles(t)[size];
39
+ const label = {
40
+ marginBottom: (0, tokens_1.tok)(t, 'space-1'),
41
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
42
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
43
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
44
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-medium'),
45
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
46
+ };
47
+ const triggerBase = {
48
+ backgroundColor: (0, tokens_1.tok)(t, 'color-input-bg'),
49
+ borderColor: (0, tokens_1.tok)(t, 'color-input-border'),
50
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
51
+ borderRadius: (0, tokens_1.tok)(t, 'radius-2'),
52
+ flexDirection: 'row',
53
+ alignItems: 'center',
54
+ justifyContent: 'space-between',
55
+ gap: (0, tokens_1.tok)(t, 'space-2'),
56
+ };
57
+ const valueText = (0, tokens_1.merge)({
58
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
59
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
60
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
61
+ flex: 1,
62
+ }, s.valueText);
63
+ const placeholder = { color: (0, tokens_1.tok)(t, 'color-input-placeholder') };
64
+ const helper = {
65
+ marginTop: (0, tokens_1.tok)(t, 'space-1'),
66
+ color: isError ? (0, tokens_1.tok)(t, 'color-status-error') : (0, tokens_1.tok)(t, 'color-fg-subtle'),
67
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
68
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-1'),
69
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
70
+ };
71
+ const focusRing = {
72
+ outlineStyle: 'solid',
73
+ outlineWidth: (0, tokens_1.tok)(t, 'border-width-focus'),
74
+ outlineColor: (0, tokens_1.tok)(t, 'color-focus-ring'),
75
+ outlineOffset: (0, tokens_1.tok)(t, 'focus-ring-gap'),
76
+ };
77
+ const triggerFocused = {
78
+ borderColor: (0, tokens_1.tok)(t, 'color-input-border-focus'),
79
+ };
80
+ const triggerError = { borderColor: (0, tokens_1.tok)(t, 'color-status-error') };
81
+ const triggerDisabled = {
82
+ backgroundColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
83
+ borderColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
84
+ };
85
+ const textDisabled = { color: (0, tokens_1.tok)(t, 'color-state-disabled-fg') };
86
+ const rightIcon = {
87
+ width: (0, tokens_1.tok)(t, 'typography-font-size-4'),
88
+ height: (0, tokens_1.tok)(t, 'typography-font-size-4'),
89
+ color: isDisabled
90
+ ? (0, tokens_1.tok)(t, 'color-state-disabled-fg')
91
+ : (0, tokens_1.tok)(t, 'color-fg-muted'),
92
+ };
93
+ // Dropdown menu
94
+ const dropdown = {
95
+ zIndex: (0, tokens_1.tok)(t, 'z-index-layer-dropdown'),
96
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
97
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
98
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
99
+ borderRadius: (0, tokens_1.tok)(t, 'radius-3'),
100
+ shadow: (0, tokens_1.tok)(t, 'shadow-level-3'),
101
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
102
+ overflow: 'hidden',
103
+ display: isOpen ? 'flex' : 'none',
104
+ };
105
+ const item = {
106
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
107
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
108
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
109
+ flexDirection: 'row',
110
+ alignItems: 'center',
111
+ justifyContent: 'space-between',
112
+ gap: (0, tokens_1.tok)(t, 'space-2'),
113
+ };
114
+ const itemLabel = {
115
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
116
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
117
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
118
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
119
+ };
120
+ const itemSelected = {
121
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface-alt'),
122
+ };
123
+ return {
124
+ label,
125
+ trigger: (0, tokens_1.merge)(triggerBase, s.trigger, isFocused && triggerFocused, isError && triggerError, isDisabled && triggerDisabled),
126
+ valueText: (0, tokens_1.merge)(valueText, isDisabled && textDisabled),
127
+ placeholder: (0, tokens_1.merge)(placeholder),
128
+ helper,
129
+ rightIcon,
130
+ focusRing: (0, tokens_1.merge)(isFocused ? focusRing : undefined),
131
+ dropdown,
132
+ item,
133
+ itemLabel,
134
+ itemSelected,
135
+ };
136
+ };
137
+ exports.getSelectParts = getSelectParts;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSkeletonStyle = exports.getSkeletonParts = void 0;
4
+ // styles/skeleton.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getSkeletonParts = (t) => {
7
+ const m = (0, tokens_1.motion)(t, 'micro-interaction');
8
+ return {
9
+ base: {
10
+ backgroundColor: (0, tokens_1.tok)(t, 'color-bg-subtle'),
11
+ overflow: 'hidden',
12
+ },
13
+ animation: {
14
+ animationPreset: 'micro-interaction',
15
+ animationDurationMs: m.durationMs,
16
+ animationEasing: m.easing,
17
+ },
18
+ };
19
+ };
20
+ exports.getSkeletonParts = getSkeletonParts;
21
+ const getSkeletonStyle = (t, opts = {}) => {
22
+ const variant = opts.variant ?? 'rect';
23
+ const radiusByVariant = {
24
+ text: { borderRadius: (0, tokens_1.tok)(t, 'radius-2') },
25
+ rect: { borderRadius: (0, tokens_1.tok)(t, 'radius-3') },
26
+ circle: { borderRadius: (0, tokens_1.tok)(t, 'radius-full') },
27
+ };
28
+ return (0, tokens_1.merge)((0, exports.getSkeletonParts)(t).base, radiusByVariant[variant], {
29
+ width: opts.width ?? '100%',
30
+ height: opts.height ??
31
+ (variant === 'text' ? (0, tokens_1.tok)(t, 'space-3') : (0, tokens_1.tok)(t, 'tap-target-min')),
32
+ }, (0, exports.getSkeletonParts)(t).animation);
33
+ };
34
+ exports.getSkeletonStyle = getSkeletonStyle;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStepVisual = exports.getStepperParts = void 0;
4
+ // styles/steppers.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getStepperParts = (t) => ({
7
+ container: {
8
+ flexDirection: 'row',
9
+ alignItems: 'center',
10
+ gap: (0, tokens_1.tok)(t, 'space-3'),
11
+ },
12
+ step: { flexDirection: 'column', gap: (0, tokens_1.tok)(t, 'space-1') },
13
+ bullet: {
14
+ width: (0, tokens_1.tok)(t, 'space-4'),
15
+ height: (0, tokens_1.tok)(t, 'space-4'),
16
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
17
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
18
+ borderColor: (0, tokens_1.tok)(t, 'color-border-strong'),
19
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
20
+ alignItems: 'center',
21
+ justifyContent: 'center',
22
+ },
23
+ line: {
24
+ height: (0, tokens_1.tok)(t, 'border-width-default'),
25
+ flex: 1,
26
+ backgroundColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
27
+ },
28
+ label: {
29
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
30
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
31
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
32
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-medium'),
33
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
34
+ },
35
+ subtitle: {
36
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
37
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
38
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-1'),
39
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-regular'),
40
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
41
+ },
42
+ });
43
+ exports.getStepperParts = getStepperParts;
44
+ const getStepVisual = (t, s = {}) => {
45
+ const completed = Boolean(s.completed);
46
+ const active = Boolean(s.active);
47
+ const disabled = Boolean(s.disabled);
48
+ const bulletCompleted = {
49
+ backgroundColor: (0, tokens_1.tok)(t, 'color-status-success'),
50
+ borderColor: (0, tokens_1.tok)(t, 'color-status-success'),
51
+ };
52
+ const bulletActive = {
53
+ backgroundColor: (0, tokens_1.tok)(t, 'color-action-primary'),
54
+ borderColor: (0, tokens_1.tok)(t, 'color-action-primary'),
55
+ };
56
+ const bulletDisabled = {
57
+ backgroundColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
58
+ borderColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
59
+ };
60
+ const lineCompleted = {
61
+ backgroundColor: (0, tokens_1.tok)(t, 'color-status-success'),
62
+ };
63
+ const lineActive = { backgroundColor: (0, tokens_1.tok)(t, 'color-action-primary') };
64
+ const labelDisabled = { color: (0, tokens_1.tok)(t, 'color-state-disabled-fg') };
65
+ return {
66
+ bullet: (0, tokens_1.merge)((0, exports.getStepperParts)(t).bullet, completed && bulletCompleted, active && bulletActive, disabled && bulletDisabled),
67
+ line: (0, tokens_1.merge)((0, exports.getStepperParts)(t).line, completed && lineCompleted, active && lineActive),
68
+ label: (0, tokens_1.merge)((0, exports.getStepperParts)(t).label, disabled && labelDisabled),
69
+ };
70
+ };
71
+ exports.getStepVisual = getStepVisual;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSwitchParts = void 0;
4
+ // styles/switches.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getSwitchParts = (t, s = {}) => {
7
+ const on = Boolean(s.on);
8
+ const disabled = Boolean(s.disabled);
9
+ const wrapper = {
10
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
11
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
12
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-2'),
13
+ flexDirection: 'row',
14
+ alignItems: 'center',
15
+ justifyContent: 'space-between',
16
+ gap: (0, tokens_1.tok)(t, 'space-3'),
17
+ };
18
+ // Track: 44x24-ish (token-first)
19
+ const trackBase = {
20
+ width: (0, tokens_1.tok)(t, 'space-6'), // 32 (aprox; ajusta no runtime se precisares)
21
+ height: (0, tokens_1.tok)(t, 'space-4'), // 16
22
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
23
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
24
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
25
+ backgroundColor: (0, tokens_1.tok)(t, 'color-bg-subtle'),
26
+ padding: (0, tokens_1.tok)(t, 'space-1'),
27
+ justifyContent: 'center',
28
+ };
29
+ const trackOn = {
30
+ backgroundColor: (0, tokens_1.tok)(t, 'color-accent'),
31
+ borderColor: (0, tokens_1.tok)(t, 'color-accent'),
32
+ };
33
+ const trackDisabled = {
34
+ backgroundColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
35
+ borderColor: (0, tokens_1.tok)(t, 'color-state-disabled-bg'),
36
+ };
37
+ const thumbBase = {
38
+ width: (0, tokens_1.tok)(t, 'space-3'),
39
+ height: (0, tokens_1.tok)(t, 'space-3'),
40
+ borderRadius: (0, tokens_1.tok)(t, 'radius-full'),
41
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
42
+ // semântico: o runtime move (translateX) conforme `on`
43
+ translateX: on ? (0, tokens_1.tok)(t, 'space-2') : 0,
44
+ };
45
+ const thumbDisabled = {
46
+ backgroundColor: (0, tokens_1.tok)(t, 'color-state-disabled-fg'),
47
+ };
48
+ const label = {
49
+ flex: 1,
50
+ color: disabled
51
+ ? (0, tokens_1.tok)(t, 'color-state-disabled-fg')
52
+ : (0, tokens_1.tok)(t, 'color-fg-default'),
53
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
54
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
55
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
56
+ };
57
+ const focusRing = {
58
+ outlineStyle: 'solid',
59
+ outlineWidth: (0, tokens_1.tok)(t, 'border-width-focus'),
60
+ outlineColor: (0, tokens_1.tok)(t, 'color-focus-ring'),
61
+ outlineOffset: (0, tokens_1.tok)(t, 'focus-ring-gap'),
62
+ };
63
+ const interaction = s.pressed
64
+ ? { opacity: (0, tokens_1.tok)(t, 'opacity-pressed') }
65
+ : s.hovered
66
+ ? { opacity: 0.96 }
67
+ : {};
68
+ return {
69
+ wrapper: (0, tokens_1.merge)(wrapper, interaction),
70
+ track: (0, tokens_1.merge)(trackBase, on && trackOn, disabled && trackDisabled),
71
+ thumb: (0, tokens_1.merge)(thumbBase, disabled && thumbDisabled),
72
+ label: (0, tokens_1.merge)(label),
73
+ focusRing: (0, tokens_1.merge)(s.focusVisible ? focusRing : undefined),
74
+ };
75
+ };
76
+ exports.getSwitchParts = getSwitchParts;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTableParts = void 0;
4
+ // styles/tables.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getTableParts = (t) => ({
7
+ container: {
8
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
9
+ borderColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
10
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
11
+ borderRadius: (0, tokens_1.tok)(t, 'radius-4'),
12
+ overflow: 'hidden',
13
+ },
14
+ headerRow: {
15
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface-alt'),
16
+ borderBottomWidth: (0, tokens_1.tok)(t, 'border-width-default'),
17
+ borderBottomColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
18
+ },
19
+ headerCell: {
20
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
21
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
22
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
23
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
24
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-2'),
25
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-strong'),
26
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
27
+ },
28
+ row: {
29
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface'),
30
+ borderBottomWidth: (0, tokens_1.tok)(t, 'border-width-default'),
31
+ borderBottomColor: (0, tokens_1.tok)(t, 'color-border-subtle'),
32
+ },
33
+ cell: {
34
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
35
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-4'),
36
+ color: (0, tokens_1.tok)(t, 'color-fg-default'),
37
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
38
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
39
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-regular'),
40
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
41
+ },
42
+ rowHover: {
43
+ backgroundColor: (0, tokens_1.tok)(t, 'color-bg-subtle'),
44
+ },
45
+ rowSelected: {
46
+ backgroundColor: (0, tokens_1.tok)(t, 'color-surface-alt'),
47
+ },
48
+ emptyState: {
49
+ padding: (0, tokens_1.tok)(t, 'space-5'),
50
+ color: (0, tokens_1.tok)(t, 'color-fg-muted'),
51
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
52
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
53
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
54
+ textAlign: 'center',
55
+ },
56
+ });
57
+ exports.getTableParts = getTableParts;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTabParts = exports.getTabsListStyle = void 0;
4
+ // styles/tabs.ts
5
+ const tokens_1 = require("../types/tokens");
6
+ const getTabsListStyle = (t, variant = 'underline') => ({
7
+ flexDirection: 'row',
8
+ gap: (0, tokens_1.tok)(t, 'space-2'),
9
+ padding: (0, tokens_1.tok)(t, 'space-2'),
10
+ borderBottomWidth: variant === 'underline' ? (0, tokens_1.tok)(t, 'border-width-default') : 0,
11
+ borderBottomColor: variant === 'underline' ? (0, tokens_1.tok)(t, 'color-border-subtle') : 'transparent',
12
+ });
13
+ exports.getTabsListStyle = getTabsListStyle;
14
+ const getTabParts = (t, variant, s = {}) => {
15
+ const active = Boolean(s.active);
16
+ const disabled = Boolean(s.disabled);
17
+ const baseTab = {
18
+ minHeight: (0, tokens_1.tok)(t, 'tap-target-min'),
19
+ paddingHorizontal: (0, tokens_1.tok)(t, 'space-3'),
20
+ paddingVertical: (0, tokens_1.tok)(t, 'space-2'),
21
+ borderRadius: variant === 'pill' ? (0, tokens_1.tok)(t, 'radius-full') : (0, tokens_1.tok)(t, 'radius-2'),
22
+ alignItems: 'center',
23
+ justifyContent: 'center',
24
+ };
25
+ const baseLabel = {
26
+ fontFamily: (0, tokens_1.tok)(t, 'typography-font-family-base'),
27
+ fontSize: (0, tokens_1.tok)(t, 'typography-font-size-3'),
28
+ fontWeight: (0, tokens_1.tok)(t, 'typography-font-weight-medium'),
29
+ lineHeight: (0, tokens_1.tok)(t, 'typography-line-height-default'),
30
+ color: disabled
31
+ ? (0, tokens_1.tok)(t, 'color-state-disabled-fg')
32
+ : active
33
+ ? (0, tokens_1.tok)(t, 'color-fg-default')
34
+ : (0, tokens_1.tok)(t, 'color-fg-muted'),
35
+ };
36
+ const indicator = variant === 'pill'
37
+ ? {
38
+ backgroundColor: active ? (0, tokens_1.tok)(t, 'color-surface-alt') : 'transparent',
39
+ borderWidth: (0, tokens_1.tok)(t, 'border-width-default'),
40
+ borderColor: active ? (0, tokens_1.tok)(t, 'color-border-strong') : 'transparent',
41
+ }
42
+ : {
43
+ // underline
44
+ borderBottomWidth: (0, tokens_1.tok)(t, 'border-width-focus'),
45
+ borderBottomColor: active
46
+ ? (0, tokens_1.tok)(t, 'color-action-primary')
47
+ : 'transparent',
48
+ };
49
+ const focusRing = {
50
+ outlineStyle: 'solid',
51
+ outlineWidth: (0, tokens_1.tok)(t, 'border-width-focus'),
52
+ outlineColor: (0, tokens_1.tok)(t, 'color-focus-ring'),
53
+ outlineOffset: (0, tokens_1.tok)(t, 'focus-ring-gap'),
54
+ };
55
+ const interaction = s.pressed
56
+ ? { opacity: (0, tokens_1.tok)(t, 'opacity-pressed') }
57
+ : s.hovered
58
+ ? { opacity: 0.96 }
59
+ : {};
60
+ const disabledStyle = disabled
61
+ ? { opacity: (0, tokens_1.tok)(t, 'opacity-disabled') }
62
+ : {};
63
+ return {
64
+ list: {},
65
+ tab: (0, tokens_1.merge)(baseTab, interaction, disabledStyle),
66
+ label: (0, tokens_1.merge)(baseLabel),
67
+ indicator,
68
+ focusRing: (0, tokens_1.merge)(s.focusVisible ? focusRing : undefined),
69
+ };
70
+ };
71
+ exports.getTabParts = getTabParts;