@1doc/1ds-react 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +34 -0
  2. package/dist/components/Alert/Alert.css +188 -0
  3. package/dist/components/Alert/Alert.d.ts +65 -0
  4. package/dist/components/Alert/Alert.js +56 -0
  5. package/dist/components/Avatar/Avatar.css +88 -0
  6. package/dist/components/Avatar/Avatar.d.ts +34 -0
  7. package/dist/components/Avatar/Avatar.js +16 -0
  8. package/dist/components/Avatar/AvatarGroup.d.ts +12 -0
  9. package/dist/components/Avatar/AvatarGroup.js +8 -0
  10. package/dist/components/Badge/Badge.css +155 -0
  11. package/dist/components/Badge/Badge.d.ts +46 -0
  12. package/dist/components/Badge/Badge.js +17 -0
  13. package/dist/components/Button/Button.css +199 -0
  14. package/dist/components/Button/Button.d.ts +23 -0
  15. package/dist/components/Button/Button.js +62 -0
  16. package/dist/components/Checkbox/Checkbox.css +122 -0
  17. package/dist/components/Checkbox/Checkbox.d.ts +21 -0
  18. package/dist/components/Checkbox/Checkbox.js +49 -0
  19. package/dist/components/Divider/Divider.css +81 -0
  20. package/dist/components/Divider/Divider.d.ts +18 -0
  21. package/dist/components/Divider/Divider.js +26 -0
  22. package/dist/components/Grid/Grid.css +154 -0
  23. package/dist/components/Grid/Grid.d.ts +21 -0
  24. package/dist/components/Grid/Grid.js +53 -0
  25. package/dist/components/Icon/Icon.css +41 -0
  26. package/dist/components/Icon/Icon.d.ts +12 -0
  27. package/dist/components/Icon/Icon.js +29 -0
  28. package/dist/components/Input/Input.css +190 -0
  29. package/dist/components/Input/Input.d.ts +32 -0
  30. package/dist/components/Input/Input.js +58 -0
  31. package/dist/components/Link/Link.css +76 -0
  32. package/dist/components/Link/Link.d.ts +15 -0
  33. package/dist/components/Link/Link.js +19 -0
  34. package/dist/components/Logo/Logo.css +32 -0
  35. package/dist/components/Logo/Logo.d.ts +10 -0
  36. package/dist/components/Logo/Logo.js +16 -0
  37. package/dist/components/Modal/Modal.css +155 -0
  38. package/dist/components/Modal/Modal.d.ts +36 -0
  39. package/dist/components/Modal/Modal.js +55 -0
  40. package/dist/components/Radio/Radio.css +114 -0
  41. package/dist/components/Radio/Radio.d.ts +19 -0
  42. package/dist/components/Radio/Radio.js +39 -0
  43. package/dist/components/Select/Select.css +291 -0
  44. package/dist/components/Select/Select.d.ts +38 -0
  45. package/dist/components/Select/Select.js +246 -0
  46. package/dist/components/Spinner/Spinner.css +60 -0
  47. package/dist/components/Spinner/Spinner.d.ts +16 -0
  48. package/dist/components/Spinner/Spinner.js +16 -0
  49. package/dist/components/Switch/Switch.css +127 -0
  50. package/dist/components/Switch/Switch.d.ts +18 -0
  51. package/dist/components/Switch/Switch.js +57 -0
  52. package/dist/components/Tabs/Tab.d.ts +19 -0
  53. package/dist/components/Tabs/Tab.js +76 -0
  54. package/dist/components/Tabs/TabContent.d.ts +15 -0
  55. package/dist/components/Tabs/TabContent.js +11 -0
  56. package/dist/components/Tabs/Tabs.css +124 -0
  57. package/dist/components/Tabs/Tabs.d.ts +20 -0
  58. package/dist/components/Tabs/Tabs.js +14 -0
  59. package/dist/components/Tabs/TabsContent.d.ts +16 -0
  60. package/dist/components/Tabs/TabsContent.js +12 -0
  61. package/dist/components/Tabs/tabs.context.d.ts +2 -0
  62. package/dist/components/Tabs/tabs.context.js +2 -0
  63. package/dist/components/Tag/Tag.css +140 -0
  64. package/dist/components/Tag/Tag.d.ts +63 -0
  65. package/dist/components/Tag/Tag.js +48 -0
  66. package/dist/components/Text/Text.css +1213 -0
  67. package/dist/components/Text/Text.d.ts +70 -0
  68. package/dist/components/Text/Text.js +89 -0
  69. package/dist/components/Textarea/Textarea.css +133 -0
  70. package/dist/components/Textarea/Textarea.d.ts +28 -0
  71. package/dist/components/Textarea/Textarea.js +72 -0
  72. package/dist/index.d.ts +25 -0
  73. package/dist/index.js +27 -0
  74. package/dist/utils/theme.d.ts +30 -0
  75. package/dist/utils/theme.js +106 -0
  76. package/package.json +26 -0
  77. package/scripts/postbuild.js +21 -0
  78. package/src/index.ts +28 -0
  79. package/src/utils/theme.ts +136 -0
  80. package/tsconfig.json +29 -0
@@ -0,0 +1,127 @@
1
+ .umds-switch {
2
+ appearance: none;
3
+ background-color: var(--umds-semantic-color-neutral-light-down);
4
+ /* Off state */
5
+ border: none;
6
+ border-radius: var(--umds-primitive-border-radius-pill);
7
+ cursor: pointer;
8
+ display: inline-flex;
9
+ padding: 2px;
10
+ position: relative;
11
+ transition: background-color 0.2s ease;
12
+ vertical-align: middle;
13
+ box-sizing: border-box;
14
+ }
15
+
16
+ .umds-switch:focus-visible {
17
+ outline: 2px solid var(--umds-semantic-color-neutral-dark-down);
18
+ outline-offset: 2px;
19
+ box-shadow: none;
20
+ }
21
+
22
+ .umds-switch[aria-checked="true"] {
23
+ background-color: var(--umds-semantic-color-primary-pure);
24
+ }
25
+
26
+ .umds-switch:disabled {
27
+ opacity: 0.5;
28
+ cursor: not-allowed;
29
+ }
30
+
31
+ /* Thumb */
32
+ .umds-switch__thumb {
33
+ background-color: var(--umds-semantic-color-neutral-light-pure, white);
34
+ border-radius: var(--umds-primitive-border-radius-circular);
35
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1), 0 1px 1px 0 rgba(0, 0, 0, 0.06);
36
+ display: flex;
37
+ align-items: center;
38
+ justify-content: center;
39
+ transition: transform 0.2s ease;
40
+ transform: translateX(0);
41
+
42
+ /* Icon styles inherited from thumb */
43
+ pointer-events: none;
44
+ color: var(--umds-semantic-color-neutral-pure);
45
+ }
46
+
47
+ .umds-switch[aria-checked="true"] .umds-switch__thumb {
48
+ color: var(--umds-semantic-color-primary-pure);
49
+ }
50
+
51
+ /* Sizes */
52
+ /* Large */
53
+ .umds-switch--large {
54
+ width: 66px;
55
+ height: 36px;
56
+ padding: 2px;
57
+ }
58
+
59
+ .umds-switch--large .umds-switch__thumb {
60
+ width: var(--umds-primitive-spacing-xs);
61
+ height: var(--umds-primitive-spacing-xs);
62
+ }
63
+
64
+ .umds-switch--large[aria-checked="true"] .umds-switch__thumb {
65
+ transform: translateX(30px);
66
+ /* 66 - 2 - 32 - 2 = 30 */
67
+ }
68
+
69
+ /* Medium */
70
+ .umds-switch--medium {
71
+ width: 52px;
72
+ height: 28px;
73
+ padding: 2px;
74
+ /* Assuming 2px */
75
+ }
76
+
77
+ .umds-switch--medium .umds-switch__thumb {
78
+ width: var(--umds-primitive-spacing-xxs);
79
+ height: var(--umds-primitive-spacing-xxs);
80
+ }
81
+
82
+ .umds-switch--medium[aria-checked="true"] .umds-switch__thumb {
83
+ transform: translateX(24px);
84
+ /* 52 - 2 - 24 - 2 = 24 */
85
+ }
86
+
87
+ /* Small */
88
+ .umds-switch--small {
89
+ width: 44px;
90
+ height: var(--umds-primitive-spacing-xxs);
91
+ padding: 1.5px;
92
+ }
93
+
94
+ .umds-switch--small .umds-switch__thumb {
95
+ width: 21px;
96
+ height: 21px;
97
+ }
98
+
99
+ .umds-switch--small[aria-checked="true"] .umds-switch__thumb {
100
+ transform: translateX(20px);
101
+ /* 44 - 1.5 - 21 - 1.5 = 20 */
102
+ }
103
+
104
+ /* Wrapper (Layout) */
105
+ .umds-switch-wrapper {
106
+ display: flex;
107
+ justify-content: flex-start;
108
+ align-items: flex-start;
109
+ gap: var(--umds-primitive-spacing-xxxs);
110
+ width: 100%;
111
+ box-sizing: border-box;
112
+ }
113
+
114
+ /* Wrapper (Background Style) */
115
+ .umds-switch-wrapper--background {
116
+ background-color: var(--umds-semantic-color-neutral-light-pure, white);
117
+ padding: var(--umds-primitive-spacing-xxxs);
118
+ border-radius: var(--umds-primitive-border-radius-sm);
119
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.06);
120
+ }
121
+
122
+ .umds-switch-text {
123
+ display: flex;
124
+ flex-direction: column;
125
+ gap: var(--umds-primitive-spacing-quarck);
126
+ flex-grow: 1;
127
+ }
@@ -0,0 +1,18 @@
1
+ import './Switch.css';
2
+ export interface SwitchProps {
3
+ checked?: any;
4
+ defaultChecked?: boolean;
5
+ disabled?: boolean;
6
+ size?: "small" | "medium" | "large";
7
+ name?: string;
8
+ value?: string;
9
+ id?: string;
10
+ label?: string;
11
+ description?: string;
12
+ background?: boolean;
13
+ className?: string;
14
+ onChange?: (checked: boolean) => void;
15
+ [key: string]: any;
16
+ }
17
+ declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
18
+ export default Switch;
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import './Switch.css';
3
+ "use client";
4
+ import { useState } from "react";
5
+ import Icon from "../Icon/Icon";
6
+ import Text from "../Text/Text";
7
+ function Switch(props) {
8
+ const [internalChecked, setInternalChecked] = useState(() => props.defaultChecked || false);
9
+ function isChecked() {
10
+ return props.checked !== undefined ? props.checked : internalChecked;
11
+ }
12
+ function toggle() {
13
+ if (props.disabled)
14
+ return;
15
+ // Workaround for Mitosis Vue generation issue with getters
16
+ const current = props.checked !== undefined ? props.checked : internalChecked;
17
+ const newValue = !current;
18
+ setInternalChecked(newValue);
19
+ props.onChange?.(newValue);
20
+ }
21
+ function classes() {
22
+ return [
23
+ "umds-switch",
24
+ `umds-switch--${props.size || "large"}`,
25
+ props.disabled ? "umds-switch--disabled" : "",
26
+ !isWrapper() ? props.className : "",
27
+ ]
28
+ .filter(Boolean)
29
+ .join(" ");
30
+ }
31
+ function classesWrapper() {
32
+ return [
33
+ "umds-switch-wrapper",
34
+ props.background ? "umds-switch-wrapper--background" : "",
35
+ props.className,
36
+ ]
37
+ .filter(Boolean)
38
+ .join(" ");
39
+ }
40
+ function isWrapper() {
41
+ return !!(props.background || props.label || props.description);
42
+ }
43
+ function iconSize() {
44
+ if (props.size === "small" || props.size === "medium") {
45
+ return "sm";
46
+ }
47
+ return "lg"; // default is large (24px)
48
+ }
49
+ return (_jsxs(_Fragment, { children: [isWrapper() ? (_jsxs("div", { ...props, className: classesWrapper(), children: [_jsx("button", { type: "button", role: "switch", "aria-checked": isChecked(), disabled: props.disabled, onClick: (event) => {
50
+ event.preventDefault();
51
+ toggle();
52
+ }, name: props.name, value: props.value, id: props.id, className: classes(), children: _jsxs("span", { className: "umds-switch__thumb", children: [isChecked() ? (_jsx(_Fragment, { children: props.iconChecked || _jsx(Icon, { name: "check", size: iconSize() }) })) : null, !isChecked() ? (_jsx(_Fragment, { children: props.iconNotChecked || (_jsx(Icon, { name: "xmark", size: iconSize() })) })) : null] }) }), _jsxs("div", { className: "umds-switch-text", children: [props.label ? (_jsx(Text, { as: "span", weight: "semibold", variant: props.size === "small" ? "body2" : "body1", children: props.label })) : null, props.description ? (_jsx(Text, { as: "span", variant: "caption", color: "secondary", children: props.description })) : null] })] })) : null, !isWrapper() ? (_jsx("button", { type: "button", role: "switch", "aria-checked": isChecked(), disabled: props.disabled, onClick: (event) => {
53
+ event.preventDefault();
54
+ toggle();
55
+ }, ...props, className: classes(), children: _jsxs("span", { className: "umds-switch__thumb", children: [isChecked() ? (_jsx(_Fragment, { children: props.iconChecked || _jsx(Icon, { name: "check", size: iconSize() }) })) : null, !isChecked() ? (_jsx(_Fragment, { children: props.iconNotChecked || (_jsx(Icon, { name: "xmark", size: iconSize() })) })) : null] }) })) : null] }));
56
+ }
57
+ export default Switch;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Propriedades do componente Tab.
3
+ * @description Representa uma aba individual dentro do componente Tabs.
4
+ */
5
+ export interface TabProps {
6
+ /** Texto exibido na tab */
7
+ label: string;
8
+ /** Identificador único da tab. Deve corresponder ao index do TabContent */
9
+ index: string;
10
+ /** Nome do ícone Iconoir a ser exibido (opcional) */
11
+ icon?: string;
12
+ /** Se a tab está desabilitada */
13
+ disabled?: boolean;
14
+ /** Classes CSS adicionais */
15
+ className?: string;
16
+ [key: string]: any;
17
+ }
18
+ declare function Tab(props: TabProps): import("react/jsx-runtime").JSX.Element;
19
+ export default Tab;
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useContext } from "react";
4
+ import TabsContext from "./tabs.context";
5
+ import Icon from "../Icon/Icon";
6
+ function Tab(props) {
7
+ function isSelected() {
8
+ return tabsContext.value === props.index;
9
+ }
10
+ function classes() {
11
+ return [
12
+ "umds-tabs__tab",
13
+ isSelected() ? "umds-tabs__tab--selected" : "",
14
+ props.disabled ? "umds-tabs__tab--disabled" : "",
15
+ props.className,
16
+ ]
17
+ .filter(Boolean)
18
+ .join(" ");
19
+ }
20
+ function labelClasses() {
21
+ return [
22
+ "umds-tabs__label",
23
+ isSelected() ? "umds-tabs__label--selected" : "",
24
+ ]
25
+ .filter(Boolean)
26
+ .join(" ");
27
+ }
28
+ function handleClick() {
29
+ if (props.disabled)
30
+ return;
31
+ if (typeof tabsContext.onChange === "function") {
32
+ tabsContext.onChange(props.index);
33
+ }
34
+ }
35
+ function handleKeyDown(event) {
36
+ if (props.disabled)
37
+ return;
38
+ if (event.key === "Enter" || event.key === " ") {
39
+ event.preventDefault();
40
+ handleClick();
41
+ return;
42
+ }
43
+ const tablist = event.target.closest('[role="tablist"]');
44
+ if (!tablist)
45
+ return;
46
+ const tabs = tablist.querySelectorAll('[role="tab"]:not([disabled])');
47
+ const currentIndex = Array.from(tabs).indexOf(event.target);
48
+ let targetIndex = -1;
49
+ if (event.key === "ArrowRight") {
50
+ event.preventDefault();
51
+ targetIndex = (currentIndex + 1) % tabs.length;
52
+ }
53
+ if (event.key === "ArrowLeft") {
54
+ event.preventDefault();
55
+ targetIndex = (currentIndex - 1 + tabs.length) % tabs.length;
56
+ }
57
+ if (event.key === "Home") {
58
+ event.preventDefault();
59
+ targetIndex = 0;
60
+ }
61
+ if (event.key === "End") {
62
+ event.preventDefault();
63
+ targetIndex = tabs.length - 1;
64
+ }
65
+ if (targetIndex >= 0 && tabs[targetIndex]) {
66
+ tabs[targetIndex].focus();
67
+ const tabIndex = tabs[targetIndex].getAttribute("data-tab-index");
68
+ if (tabIndex && typeof tabsContext.onChange === "function") {
69
+ tabsContext.onChange(tabIndex);
70
+ }
71
+ }
72
+ }
73
+ const tabsContext = useContext(TabsContext);
74
+ return (_jsxs("button", { role: "tab", "data-tab-index": props.index, "aria-selected": isSelected(), "aria-disabled": props.disabled, tabIndex: isSelected() ? 0 : -1, disabled: props.disabled, onClick: (event) => handleClick(), onKeyDown: (event) => handleKeyDown(event), className: classes(), children: [props.icon ? (_jsx(Icon, { size: "md", variant: "inherit", className: "umds-tabs__icon", name: props.icon })) : null, _jsx("span", { className: labelClasses(), children: props.label })] }));
75
+ }
76
+ export default Tab;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Propriedades do componente TabContent.
3
+ * @description Painel de conteúdo individual associado a uma tab via index.
4
+ */
5
+ export interface TabContentProps {
6
+ /** Identificador da tab. Deve corresponder ao index do Tab associado */
7
+ index: string;
8
+ /** Classes CSS adicionais */
9
+ className?: string;
10
+ /** Conteúdo do painel */
11
+ children?: any;
12
+ [key: string]: any;
13
+ }
14
+ declare function TabContent(props: TabContentProps): import("react/jsx-runtime").JSX.Element;
15
+ export default TabContent;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useContext } from "react";
4
+ import TabsContext from "./tabs.context";
5
+ function TabContent(props) {
6
+ const tabsContext = useContext(TabsContext);
7
+ return (_jsx(_Fragment, { children: tabsContext.value === props.index ? (_jsx(_Fragment, { children: _jsx("div", { role: "tabpanel", "data-tab-index": props.index, className: ["umds-tabs__content", props.className]
8
+ .filter(Boolean)
9
+ .join(" "), children: props.children }) })) : null }));
10
+ }
11
+ export default TabContent;
@@ -0,0 +1,124 @@
1
+ /* ============================
2
+ Tabs Container
3
+ ============================ */
4
+ .umds-tabs {
5
+ display: flex;
6
+ flex-direction: column;
7
+ width: 100%;
8
+ font-family: var(--umds-semantic-font-family-base);
9
+ }
10
+
11
+ /* ============================
12
+ Tab List (tablist)
13
+ ============================ */
14
+ .umds-tabs__list {
15
+ display: flex;
16
+ align-items: stretch;
17
+ border-bottom: 1px solid var(--umds-semantic-color-neutral-light-down);
18
+ gap: 0;
19
+ }
20
+
21
+ /* ============================
22
+ Individual Tab Button
23
+ ============================ */
24
+ .umds-tabs__tab {
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ gap: var(--umds-primitive-spacing-nano);
29
+ padding: var(--umds-primitive-spacing-nano) var(--umds-primitive-spacing-xxxs);
30
+ border: none;
31
+ border-bottom: 3px solid transparent;
32
+ background: none;
33
+ cursor: pointer;
34
+ position: relative;
35
+ transition: all 0.2s ease-in-out;
36
+ font-family: var(--umds-semantic-font-family-base);
37
+ color: var(--umds-semantic-color-neutral-dark-pure);
38
+ }
39
+
40
+ /* ============================
41
+ Label
42
+ ============================ */
43
+ .umds-tabs__label {
44
+ font-weight: var(--umds-primitive-font-weight-regular);
45
+ color: var(--umds-semantic-color-neutral-dark-pure);
46
+ white-space: nowrap;
47
+ }
48
+
49
+ .umds-tabs__label--selected {
50
+ font-weight: var(--umds-primitive-font-weight-bold);
51
+ color: var(--umds-semantic-color-neutral-dark-pure);
52
+ }
53
+
54
+ /* ============================
55
+ Icon
56
+ ============================ */
57
+ .umds-tabs__icon {
58
+ flex-shrink: 0;
59
+ color: inherit;
60
+ }
61
+
62
+ /* ============================
63
+ Hover State
64
+ ============================ */
65
+ .umds-tabs__tab:hover:not(:disabled):not(.umds-tabs__tab--selected) {
66
+ border-bottom-color: var(--umds-semantic-color-primary-pure);
67
+ border-bottom-width: 1px;
68
+ padding-bottom: calc(var(--umds-primitive-spacing-nano) + 2px);
69
+ }
70
+
71
+ /* ============================
72
+ Selected State
73
+ ============================ */
74
+ .umds-tabs__tab--selected {
75
+ border-bottom-color: var(--umds-semantic-color-primary-pure);
76
+ border-bottom-width: 3px;
77
+ }
78
+
79
+ /* ============================
80
+ Focus State
81
+ ============================ */
82
+ .umds-tabs__tab:focus-visible {
83
+ outline: 2px solid var(--umds-semantic-color-neutral-dark-pure);
84
+ outline-offset: -2px;
85
+ border-radius: var(--umds-primitive-border-radius-sm) var(--umds-primitive-border-radius-sm) 0 0;
86
+ }
87
+
88
+ .umds-tabs__tab:focus:not(:focus-visible) {
89
+ outline: none;
90
+ }
91
+
92
+ /* ============================
93
+ Disabled State
94
+ ============================ */
95
+ .umds-tabs__tab--disabled,
96
+ .umds-tabs__tab:disabled {
97
+ cursor: not-allowed;
98
+ color: var(--umds-semantic-color-neutral-dark-up);
99
+ opacity: 0.6;
100
+ }
101
+
102
+ .umds-tabs__tab--disabled .umds-tabs__label,
103
+ .umds-tabs__tab:disabled .umds-tabs__label {
104
+ color: var(--umds-semantic-color-neutral-dark-up);
105
+ }
106
+
107
+ .umds-tabs__tab--disabled .umds-tabs__icon,
108
+ .umds-tabs__tab:disabled .umds-tabs__icon {
109
+ color: var(--umds-semantic-color-neutral-dark-up);
110
+ }
111
+
112
+ /* ============================
113
+ Content Panel
114
+ ============================ */
115
+ .umds-tabs__content {
116
+ padding: var(--umds-primitive-spacing-xxs) 0;
117
+ }
118
+
119
+ /* ============================
120
+ Tabs Content Container
121
+ ============================ */
122
+ .umds-tabs-content {
123
+ width: 100%;
124
+ }
@@ -0,0 +1,20 @@
1
+ import './Tabs.css';
2
+ /**
3
+ * Propriedades do componente Tabs.
4
+ * @description Container de navegação por abas. Renderiza os botões de tab via subcomponentes <Tab />.
5
+ */
6
+ export interface TabsProps {
7
+ /** Valor da tab ativa (controlado) */
8
+ value: string;
9
+ /** Callback chamado quando uma tab é selecionada */
10
+ onChange?: (index: string) => void;
11
+ /** Label de acessibilidade para o tablist */
12
+ ariaLabel?: string;
13
+ /** Classes CSS adicionais */
14
+ className?: string;
15
+ /** Subcomponentes Tab */
16
+ children?: any;
17
+ [key: string]: any;
18
+ }
19
+ declare function Tabs(props: TabsProps): import("react/jsx-runtime").JSX.Element;
20
+ export default Tabs;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import './Tabs.css';
3
+ "use client";
4
+ import TabsContext from "./tabs.context";
5
+ function Tabs(props) {
6
+ function classes() {
7
+ return ["umds-tabs", props.className].filter(Boolean).join(" ");
8
+ }
9
+ return (_jsx(TabsContext.Provider, { value: {
10
+ value: props.value,
11
+ onChange: props.onChange,
12
+ }, children: _jsx("div", { className: classes(), children: _jsx("div", { role: "tablist", className: "umds-tabs__list", "aria-label": props.ariaLabel, children: props.children }) }) }));
13
+ }
14
+ export default Tabs;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Propriedades do componente TabsContent.
3
+ * @description Container para os painéis de conteúdo das tabs.
4
+ * Deve receber o mesmo value usado no componente Tabs.
5
+ */
6
+ export interface TabsContentProps {
7
+ /** Valor da tab ativa. Deve ser o mesmo value do componente Tabs */
8
+ value: string;
9
+ /** Classes CSS adicionais */
10
+ className?: string;
11
+ /** Subcomponentes TabContent */
12
+ children?: any;
13
+ [key: string]: any;
14
+ }
15
+ declare function TabsContent(props: TabsContentProps): import("react/jsx-runtime").JSX.Element;
16
+ export default TabsContent;
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import TabsContext from "./tabs.context";
4
+ function TabsContent(props) {
5
+ return (_jsx(TabsContext.Provider, { value: {
6
+ value: props.value,
7
+ onChange() { },
8
+ }, children: _jsx("div", { className: ["umds-tabs-content", props.className]
9
+ .filter(Boolean)
10
+ .join(" "), children: props.children }) }));
11
+ }
12
+ export default TabsContent;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("react").Context<any>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import { createContext } from "react";
2
+ export default createContext({ value: "", onChange(_index) { } });
@@ -0,0 +1,140 @@
1
+ /* ============================================
2
+ Tag Component
3
+ Variantes: outlined, solid
4
+ Tamanhos: sm, md, lg
5
+ ============================================ */
6
+
7
+ .umds-tag {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ box-sizing: border-box;
11
+ font-family: var(--umds-semantic-font-family-base);
12
+ font-weight: var(--umds-primitive-font-weight-semibold);
13
+ line-height: 1;
14
+ white-space: nowrap;
15
+ border: 1px solid transparent;
16
+ cursor: default;
17
+ transition: all 0.15s ease;
18
+ max-width: 100%;
19
+ }
20
+
21
+ .umds-tag__label {
22
+ overflow: hidden;
23
+ text-overflow: ellipsis;
24
+ white-space: nowrap;
25
+ flex-shrink: 1;
26
+ min-width: 0;
27
+ }
28
+
29
+ .umds-tag__icon {
30
+ display: inline-flex;
31
+ align-items: center;
32
+ justify-content: center;
33
+ flex-shrink: 0;
34
+ }
35
+
36
+ .umds-tag__icon--clickable {
37
+ cursor: pointer;
38
+ border-radius: var(--umds-primitive-border-radius-xs);
39
+ transition: background-color 0.15s ease;
40
+ }
41
+
42
+ .umds-tag__icon--clickable:hover {
43
+ opacity: 0.7;
44
+ }
45
+
46
+ .umds-tag__icon--clickable:focus-visible {
47
+ outline: 2px solid var(--umds-semantic-color-primary-pure);
48
+ outline-offset: 1px;
49
+ }
50
+
51
+ .umds-tag__close {
52
+ display: inline-flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ flex-shrink: 0;
56
+ cursor: pointer;
57
+ border-radius: var(--umds-primitive-border-radius-xs);
58
+ transition: background-color 0.15s ease;
59
+ }
60
+
61
+ .umds-tag__close:hover {
62
+ opacity: 0.7;
63
+ }
64
+
65
+ .umds-tag__close:focus-visible {
66
+ outline: 2px solid var(--umds-semantic-color-primary-pure);
67
+ outline-offset: 1px;
68
+ }
69
+
70
+ /* ----------------------------------------
71
+ Sizes
72
+ ---------------------------------------- */
73
+
74
+ /* SM: border-radius 6px, gap 4px, padding 8px H / 2px V, font-size 12px */
75
+ .umds-tag--sm {
76
+ gap: 4px;
77
+ padding: 2px 8px;
78
+ border-radius: 6px;
79
+ font-size: var(--umds-primitive-font-size-xxxs);
80
+ }
81
+
82
+ /* MD: border-radius 8px, gap 8px, height 28px, padding 6px 8px, font-size 14px */
83
+ .umds-tag--md {
84
+ gap: 8px;
85
+ padding: 6px 8px;
86
+ height: 28px;
87
+ border-radius: 8px;
88
+ font-size: var(--umds-primitive-font-size-xxs);
89
+ }
90
+
91
+ /* LG: border-radius 8px, gap 8px, height 40px, padding 8px, font-size 16px */
92
+ .umds-tag--lg {
93
+ gap: 8px;
94
+ padding: 8px;
95
+ height: 40px;
96
+ border-radius: 8px;
97
+ font-size: var(--umds-primitive-font-size-xs);
98
+ }
99
+
100
+ /* ----------------------------------------
101
+ Variant: Outlined
102
+ ---------------------------------------- */
103
+ .umds-tag--outlined {
104
+ background-color: transparent;
105
+ border-color: var(--umds-semantic-color-neutral-light-down);
106
+ color: var(--umds-semantic-color-neutral-dark-down);
107
+ }
108
+
109
+ .umds-tag--outlined:hover:not(.umds-tag--disabled) {
110
+ background-color: var(--umds-semantic-color-neutral-light-medium);
111
+ }
112
+
113
+ /* ----------------------------------------
114
+ Variant: Solid
115
+ ---------------------------------------- */
116
+ .umds-tag--solid {
117
+ background-color: var(--umds-semantic-color-neutral-dark-down);
118
+ border-color: var(--umds-semantic-color-neutral-dark-down);
119
+ color: var(--umds-semantic-color-neutral-light-pure);
120
+ }
121
+
122
+ .umds-tag--solid:hover:not(.umds-tag--disabled) {
123
+ background-color: var(--umds-semantic-color-neutral-dark-medium);
124
+ border-color: var(--umds-semantic-color-neutral-dark-medium);
125
+ }
126
+
127
+ /* ----------------------------------------
128
+ Disabled
129
+ ---------------------------------------- */
130
+ .umds-tag--disabled {
131
+ opacity: 0.5;
132
+ cursor: not-allowed;
133
+ pointer-events: none;
134
+ }
135
+
136
+ .umds-tag--disabled .umds-tag__close,
137
+ .umds-tag--disabled .umds-tag__icon--clickable {
138
+ cursor: not-allowed;
139
+ pointer-events: none;
140
+ }