@expcat/tigercat-react 0.0.67 → 0.1.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 (196) hide show
  1. package/dist/chunk-2DOPHSZP.js +32 -0
  2. package/dist/chunk-2TS6X5RA.js +73 -0
  3. package/dist/chunk-2Y327ZU4.js +493 -0
  4. package/dist/chunk-3OF7XPIQ.js +90 -0
  5. package/dist/chunk-3WPKVV4N.js +140 -0
  6. package/dist/chunk-5FRENLDC.js +194 -0
  7. package/dist/chunk-5QKMQRCW.js +89 -0
  8. package/dist/chunk-5ZVSFIZD.js +50 -0
  9. package/dist/chunk-6MGEGOYJ.js +108 -0
  10. package/dist/chunk-6PUSRC6S.js +68 -0
  11. package/dist/chunk-72ZRDBXN.js +25 -0
  12. package/dist/chunk-77D7VQMG.js +43 -0
  13. package/dist/chunk-7P6PHSFM.js +548 -0
  14. package/dist/chunk-AG6GVQ5O.js +271 -0
  15. package/dist/chunk-AQ6DHCP6.js +53 -0
  16. package/dist/chunk-AQQRWISY.js +184 -0
  17. package/dist/chunk-C5EFBJBR.js +540 -0
  18. package/dist/chunk-D3I2SY7X.js +301 -0
  19. package/dist/chunk-DZJUFU55.js +300 -0
  20. package/dist/chunk-EI2GHMQS.js +37 -0
  21. package/dist/chunk-ENR3RIMM.js +205 -0
  22. package/dist/chunk-EQWQXURG.js +18 -0
  23. package/dist/chunk-EUHWE7MN.js +267 -0
  24. package/dist/chunk-FAKTU64M.js +67 -0
  25. package/dist/chunk-FQ6UHRAO.js +499 -0
  26. package/dist/chunk-GX74TC62.js +54 -0
  27. package/dist/chunk-HDDBBZQH.js +321 -0
  28. package/dist/chunk-IFY46RWU.js +25 -0
  29. package/dist/chunk-IQINYCU6.js +99 -0
  30. package/dist/chunk-IY4LEJYF.js +78 -0
  31. package/dist/chunk-JW64IJP2.js +210 -0
  32. package/dist/chunk-KUCFT2OA.js +43 -0
  33. package/dist/chunk-LNKI6HQ3.js +152 -0
  34. package/dist/chunk-LXA2YBAO.js +38 -0
  35. package/dist/chunk-MKWXJZ3T.js +74 -0
  36. package/dist/chunk-NEULKOYJ.js +48 -0
  37. package/dist/chunk-NI2WNZRT.js +38 -0
  38. package/dist/chunk-OFCKGWTS.js +12 -0
  39. package/dist/chunk-OTRGVENC.js +305 -0
  40. package/dist/chunk-P273E6XE.js +219 -0
  41. package/dist/chunk-Q3DPJHNM.js +407 -0
  42. package/dist/chunk-QFVE7GKD.js +109 -0
  43. package/dist/chunk-QL6OBKEN.js +84 -0
  44. package/dist/chunk-QL6UEG3U.js +27 -0
  45. package/dist/chunk-QORSSZX4.js +144 -0
  46. package/dist/chunk-R4JSBXGG.js +12 -0
  47. package/dist/chunk-R5BQHZWB.js +698 -0
  48. package/dist/chunk-R7MS42PL.js +90 -0
  49. package/dist/chunk-TB2UHDOZ.js +19 -0
  50. package/dist/chunk-TBIEWDY5.js +175 -0
  51. package/dist/chunk-TJFS44SH.js +48 -0
  52. package/dist/chunk-TZ26HQAW.js +85 -0
  53. package/dist/chunk-U4ZVEPYD.js +71 -0
  54. package/dist/chunk-UFAXJVMD.js +120 -0
  55. package/dist/chunk-VJJ76I7U.js +19 -0
  56. package/dist/chunk-VO4WDK4K.js +37 -0
  57. package/dist/chunk-VSF4DF7N.js +84 -0
  58. package/dist/chunk-VVO4V4IK.js +56 -0
  59. package/dist/chunk-WK5HN4OH.js +113 -0
  60. package/dist/chunk-XZDJ5FRB.js +333 -0
  61. package/dist/chunk-YE2M2HNM.js +168 -0
  62. package/dist/chunk-YYGTJKP5.js +39 -0
  63. package/dist/chunk-ZREFCRX3.js +52 -0
  64. package/dist/components/Alert.d.ts +24 -0
  65. package/dist/components/Alert.js +10 -0
  66. package/dist/components/Avatar.d.ts +12 -0
  67. package/dist/components/Avatar.js +10 -0
  68. package/dist/components/Badge.d.ts +12 -0
  69. package/dist/components/Badge.js +10 -0
  70. package/dist/components/Breadcrumb.d.ts +13 -0
  71. package/dist/components/Breadcrumb.js +14 -0
  72. package/dist/components/BreadcrumbItem.d.ts +21 -0
  73. package/dist/components/BreadcrumbItem.js +11 -0
  74. package/dist/components/Button.d.ts +8 -0
  75. package/dist/components/Button.js +10 -0
  76. package/dist/components/Card.d.ts +33 -0
  77. package/dist/components/Card.js +10 -0
  78. package/dist/components/Checkbox.d.ts +48 -0
  79. package/dist/components/Checkbox.js +11 -0
  80. package/dist/components/CheckboxGroup.d.ts +39 -0
  81. package/dist/components/CheckboxGroup.js +14 -0
  82. package/dist/components/Code.d.ts +9 -0
  83. package/dist/components/Code.js +16 -0
  84. package/dist/components/Col.d.ts +7 -0
  85. package/dist/components/Col.js +11 -0
  86. package/dist/components/ConfigProvider.d.ts +14 -0
  87. package/dist/components/ConfigProvider.js +14 -0
  88. package/dist/components/Container.d.ts +13 -0
  89. package/dist/components/Container.js +10 -0
  90. package/dist/components/Content.d.ts +9 -0
  91. package/dist/components/Content.js +10 -0
  92. package/dist/components/DatePicker.d.ts +24 -0
  93. package/dist/components/DatePicker.js +10 -0
  94. package/dist/components/Descriptions.d.ts +53 -0
  95. package/dist/components/Descriptions.js +16 -0
  96. package/dist/components/Divider.d.ts +12 -0
  97. package/dist/components/Divider.js +10 -0
  98. package/dist/components/Drawer.d.ts +19 -0
  99. package/dist/components/Drawer.js +11 -0
  100. package/dist/components/Dropdown.d.ts +22 -0
  101. package/dist/components/Dropdown.js +16 -0
  102. package/dist/components/DropdownItem.d.ts +17 -0
  103. package/dist/components/DropdownItem.js +13 -0
  104. package/dist/components/DropdownMenu.d.ts +13 -0
  105. package/dist/components/DropdownMenu.js +10 -0
  106. package/dist/components/Footer.d.ts +9 -0
  107. package/dist/components/Footer.js +10 -0
  108. package/dist/components/Form.d.ts +56 -0
  109. package/dist/components/Form.js +14 -0
  110. package/dist/components/FormItem.d.ts +16 -0
  111. package/dist/components/FormItem.js +11 -0
  112. package/dist/components/Header.d.ts +9 -0
  113. package/dist/components/Header.js +10 -0
  114. package/dist/components/Icon.d.ts +9 -0
  115. package/dist/components/Icon.js +10 -0
  116. package/dist/components/Input.d.ts +28 -0
  117. package/dist/components/Input.js +10 -0
  118. package/dist/components/Layout.d.ts +9 -0
  119. package/dist/components/Layout.js +10 -0
  120. package/dist/components/Link.d.ts +10 -0
  121. package/dist/components/Link.js +10 -0
  122. package/dist/components/List.d.ts +94 -0
  123. package/dist/components/List.js +12 -0
  124. package/dist/components/Loading.d.ts +8 -0
  125. package/dist/components/Loading.js +10 -0
  126. package/dist/components/Menu.d.ts +35 -0
  127. package/dist/components/Menu.js +14 -0
  128. package/dist/components/MenuItem.d.ts +20 -0
  129. package/dist/components/MenuItem.js +11 -0
  130. package/dist/components/MenuItemGroup.d.ts +16 -0
  131. package/dist/components/MenuItemGroup.js +12 -0
  132. package/dist/components/Message.d.ts +44 -0
  133. package/dist/components/Message.js +20 -0
  134. package/dist/components/Modal.d.ts +41 -0
  135. package/dist/components/Modal.js +11 -0
  136. package/dist/components/Notification.d.ts +40 -0
  137. package/dist/components/Notification.js +20 -0
  138. package/dist/components/Pagination.d.ts +11 -0
  139. package/dist/components/Pagination.js +16 -0
  140. package/dist/components/Popconfirm.d.ts +34 -0
  141. package/dist/components/Popconfirm.js +10 -0
  142. package/dist/components/Popover.d.ts +14 -0
  143. package/dist/components/Popover.js +10 -0
  144. package/dist/components/Progress.d.ts +8 -0
  145. package/dist/components/Progress.js +10 -0
  146. package/dist/components/Radio.d.ts +20 -0
  147. package/dist/components/Radio.js +11 -0
  148. package/dist/components/RadioGroup.d.ts +28 -0
  149. package/dist/components/RadioGroup.js +14 -0
  150. package/dist/components/Row.d.ts +11 -0
  151. package/dist/components/Row.js +14 -0
  152. package/dist/components/Select.d.ts +23 -0
  153. package/dist/components/Select.js +10 -0
  154. package/dist/components/Sidebar.d.ts +9 -0
  155. package/dist/components/Sidebar.js +10 -0
  156. package/dist/components/Skeleton.d.ts +7 -0
  157. package/dist/components/Skeleton.js +10 -0
  158. package/dist/components/Slider.d.ts +12 -0
  159. package/dist/components/Slider.js +10 -0
  160. package/dist/components/Space.d.ts +11 -0
  161. package/dist/components/Space.js +10 -0
  162. package/dist/components/Steps.d.ts +31 -0
  163. package/dist/components/Steps.js +14 -0
  164. package/dist/components/StepsItem.d.ts +36 -0
  165. package/dist/components/StepsItem.js +10 -0
  166. package/dist/components/SubMenu.d.ts +20 -0
  167. package/dist/components/SubMenu.js +13 -0
  168. package/dist/components/Switch.d.ts +12 -0
  169. package/dist/components/Switch.js +10 -0
  170. package/dist/components/TabPane.d.ts +42 -0
  171. package/dist/components/TabPane.js +10 -0
  172. package/dist/components/Table.d.ts +46 -0
  173. package/dist/components/Table.js +10 -0
  174. package/dist/components/Tabs.d.ts +43 -0
  175. package/dist/components/Tabs.js +14 -0
  176. package/dist/components/Tag.d.ts +16 -0
  177. package/dist/components/Tag.js +10 -0
  178. package/dist/components/Text.d.ts +9 -0
  179. package/dist/components/Text.js +10 -0
  180. package/dist/components/Textarea.d.ts +13 -0
  181. package/dist/components/Textarea.js +10 -0
  182. package/dist/components/TimePicker.d.ts +28 -0
  183. package/dist/components/TimePicker.js +10 -0
  184. package/dist/components/Timeline.d.ts +47 -0
  185. package/dist/components/Timeline.js +10 -0
  186. package/dist/components/Tooltip.d.ts +15 -0
  187. package/dist/components/Tooltip.js +10 -0
  188. package/dist/components/Tree.d.ts +154 -0
  189. package/dist/components/Tree.js +16 -0
  190. package/dist/components/Upload.d.ts +16 -0
  191. package/dist/components/Upload.js +11 -0
  192. package/dist/index.d.ts +77 -0
  193. package/dist/index.js +364 -0
  194. package/package.json +3 -6
  195. package/dist/styles/index.css +0 -4
  196. package/dist/styles/index.d.mts +0 -2
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var tigercatCore = require('@expcat/tigercat-core');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/components/Textarea.tsx
8
+ var Textarea = react.forwardRef(
9
+ ({
10
+ size = "md",
11
+ disabled = false,
12
+ readonly = false,
13
+ required = false,
14
+ placeholder = "",
15
+ rows = 3,
16
+ autoResize = false,
17
+ maxRows,
18
+ minRows,
19
+ maxLength,
20
+ minLength,
21
+ showCount = false,
22
+ value,
23
+ defaultValue,
24
+ onInput,
25
+ onChange,
26
+ onFocus,
27
+ onBlur,
28
+ className,
29
+ ...props
30
+ }, ref) => {
31
+ const textareaRef = react.useRef(null);
32
+ const [internalValue, setInternalValue] = react.useState(defaultValue || "");
33
+ const isControlled = value !== void 0;
34
+ const currentValue = isControlled ? value : internalValue;
35
+ const setRefs = (node) => {
36
+ textareaRef.current = node;
37
+ if (typeof ref === "function") ref(node);
38
+ else if (ref) ref.current = node;
39
+ };
40
+ react.useEffect(() => {
41
+ if (!autoResize || !textareaRef.current) return;
42
+ tigercatCore.autoResizeTextarea(textareaRef.current, { minRows, maxRows });
43
+ }, [autoResize, currentValue, minRows, maxRows]);
44
+ const textareaClasses = tigercatCore.classNames(
45
+ "block",
46
+ tigercatCore.getInputClasses(size),
47
+ autoResize ? "resize-none" : "resize-y",
48
+ className
49
+ );
50
+ const handleInput = (event) => {
51
+ if (!isControlled) {
52
+ setInternalValue(event.currentTarget.value);
53
+ }
54
+ onInput?.(event);
55
+ if (autoResize) {
56
+ tigercatCore.autoResizeTextarea(event.currentTarget, { minRows, maxRows });
57
+ }
58
+ };
59
+ const handleChange = (event) => {
60
+ onChange?.(event);
61
+ };
62
+ const currentLength = currentValue?.length ?? 0;
63
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
64
+ /* @__PURE__ */ jsxRuntime.jsx(
65
+ "textarea",
66
+ {
67
+ ref: setRefs,
68
+ className: textareaClasses,
69
+ value: currentValue,
70
+ disabled,
71
+ readOnly: readonly,
72
+ required,
73
+ placeholder,
74
+ rows,
75
+ maxLength,
76
+ minLength,
77
+ onInput: handleInput,
78
+ onChange: handleChange,
79
+ onFocus,
80
+ onBlur,
81
+ ...props
82
+ }
83
+ ),
84
+ showCount && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-sm text-gray-500 text-right", children: maxLength ? `${currentLength}/${maxLength}` : currentLength })
85
+ ] });
86
+ }
87
+ );
88
+ Textarea.displayName = "Textarea";
89
+
90
+ exports.Textarea = Textarea;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var tigercatCore = require('@expcat/tigercat-core');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/Footer.tsx
7
+ var Footer = ({
8
+ className,
9
+ height = "auto",
10
+ style,
11
+ children,
12
+ ...props
13
+ }) => {
14
+ const footerClasses = tigercatCore.classNames(tigercatCore.layoutFooterClasses, className);
15
+ const footerStyle = { ...style, height };
16
+ return /* @__PURE__ */ jsxRuntime.jsx("footer", { className: footerClasses, style: footerStyle, ...props, children });
17
+ };
18
+
19
+ exports.Footer = Footer;
@@ -0,0 +1,175 @@
1
+ 'use strict';
2
+
3
+ var chunkNEULKOYJ_js = require('./chunk-NEULKOYJ.js');
4
+ var React = require('react');
5
+ var reactDom = require('react-dom');
6
+ var tigercatCore = require('@expcat/tigercat-core');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+
9
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefault(React);
12
+
13
+ var Modal = ({
14
+ visible = false,
15
+ size = "md",
16
+ title,
17
+ titleContent,
18
+ closable = true,
19
+ mask = true,
20
+ maskClosable = true,
21
+ centered = false,
22
+ destroyOnClose = false,
23
+ zIndex = 1e3,
24
+ className,
25
+ children,
26
+ footer,
27
+ onVisibleChange,
28
+ onClose,
29
+ onCancel,
30
+ onOk: _onOk,
31
+ closeAriaLabel,
32
+ locale,
33
+ style,
34
+ ...rest
35
+ }) => {
36
+ const [hasBeenOpened, setHasBeenOpened] = React__default.default.useState(visible);
37
+ React.useEffect(() => {
38
+ if (visible) {
39
+ setHasBeenOpened(true);
40
+ }
41
+ }, [visible]);
42
+ React.useEffect(() => {
43
+ onVisibleChange?.(visible);
44
+ if (!visible && onClose) {
45
+ onClose();
46
+ }
47
+ }, [visible, onVisibleChange, onClose]);
48
+ const shouldRender = destroyOnClose ? visible : hasBeenOpened;
49
+ const handleClose = React.useCallback(() => {
50
+ onCancel?.();
51
+ onVisibleChange?.(false);
52
+ }, [onCancel, onVisibleChange]);
53
+ const handleMaskClick = React.useCallback(
54
+ (event) => {
55
+ if (maskClosable && event.target === event.currentTarget) {
56
+ handleClose();
57
+ }
58
+ },
59
+ [maskClosable, handleClose]
60
+ );
61
+ const contentClasses = React.useMemo(() => tigercatCore.getModalContentClasses(size, className), [size, className]);
62
+ const containerClasses = React.useMemo(() => tigercatCore.getModalContainerClasses(centered), [centered]);
63
+ const resolvedCloseAriaLabel = tigercatCore.resolveLocaleText(
64
+ "Close",
65
+ closeAriaLabel,
66
+ locale?.modal?.closeAriaLabel,
67
+ locale?.common?.closeText
68
+ );
69
+ const reactId = React.useId();
70
+ const modalId = React.useMemo(() => `tiger-modal-${reactId}`, [reactId]);
71
+ const titleId = `${modalId}-title`;
72
+ const {
73
+ ["aria-labelledby"]: _ariaLabelledby,
74
+ role: _role,
75
+ tabIndex: _tabIndex,
76
+ ...dialogDivProps
77
+ } = rest;
78
+ const ariaLabelledby = rest["aria-labelledby"] ?? (title || titleContent ? titleId : void 0);
79
+ const dialogRef = React.useRef(null);
80
+ const closeButtonRef = React.useRef(null);
81
+ const previousActiveElementRef = React.useRef(null);
82
+ React.useEffect(() => {
83
+ if (!visible) return;
84
+ previousActiveElementRef.current = tigercatCore.captureActiveElement();
85
+ const timer = setTimeout(() => {
86
+ tigercatCore.focusFirst([closeButtonRef.current, dialogRef.current]);
87
+ }, 0);
88
+ return () => clearTimeout(timer);
89
+ }, [visible]);
90
+ React.useEffect(() => {
91
+ if (visible) return;
92
+ tigercatCore.restoreFocus(previousActiveElementRef.current);
93
+ }, [visible]);
94
+ chunkNEULKOYJ_js.useEscapeKey({ enabled: visible, onEscape: handleClose });
95
+ const CloseIcon = /* @__PURE__ */ jsxRuntime.jsx(
96
+ "svg",
97
+ {
98
+ className: "h-5 w-5",
99
+ xmlns: "http://www.w3.org/2000/svg",
100
+ fill: "none",
101
+ viewBox: tigercatCore.closeIconViewBox,
102
+ stroke: "currentColor",
103
+ children: /* @__PURE__ */ jsxRuntime.jsx(
104
+ "path",
105
+ {
106
+ strokeLinecap: tigercatCore.closeIconPathStrokeLinecap,
107
+ strokeLinejoin: tigercatCore.closeIconPathStrokeLinejoin,
108
+ strokeWidth: tigercatCore.closeIconPathStrokeWidth,
109
+ d: tigercatCore.closeIconPathD
110
+ }
111
+ )
112
+ }
113
+ );
114
+ if (!shouldRender) {
115
+ return null;
116
+ }
117
+ if (destroyOnClose && !visible) {
118
+ return null;
119
+ }
120
+ const modalContent = /* @__PURE__ */ jsxRuntime.jsxs(
121
+ "div",
122
+ {
123
+ className: tigercatCore.classNames(tigercatCore.modalWrapperClasses, !visible && "pointer-events-none"),
124
+ style: { zIndex },
125
+ hidden: !visible,
126
+ "aria-hidden": !visible ? "true" : void 0,
127
+ "data-tiger-modal-root": "",
128
+ children: [
129
+ mask && /* @__PURE__ */ jsxRuntime.jsx(
130
+ "div",
131
+ {
132
+ className: tigercatCore.classNames(tigercatCore.modalMaskClasses, visible ? "opacity-100" : "opacity-0"),
133
+ "aria-hidden": "true",
134
+ "data-tiger-modal-mask": ""
135
+ }
136
+ ),
137
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: containerClasses, onClick: handleMaskClick, children: /* @__PURE__ */ jsxRuntime.jsxs(
138
+ "div",
139
+ {
140
+ className: tigercatCore.classNames(contentClasses),
141
+ style,
142
+ ...dialogDivProps,
143
+ role: "dialog",
144
+ "aria-modal": "true",
145
+ "aria-labelledby": ariaLabelledby,
146
+ tabIndex: -1,
147
+ ref: dialogRef,
148
+ "data-tiger-modal": "",
149
+ children: [
150
+ (title || titleContent || closable) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.modalHeaderClasses, children: [
151
+ (title || titleContent) && /* @__PURE__ */ jsxRuntime.jsx("h3", { id: titleId, className: tigercatCore.modalTitleClasses, children: titleContent || title }),
152
+ closable && /* @__PURE__ */ jsxRuntime.jsx(
153
+ "button",
154
+ {
155
+ type: "button",
156
+ className: tigercatCore.modalCloseButtonClasses,
157
+ onClick: handleClose,
158
+ "aria-label": resolvedCloseAriaLabel,
159
+ ref: closeButtonRef,
160
+ children: CloseIcon
161
+ }
162
+ )
163
+ ] }),
164
+ children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.modalBodyClasses, children }),
165
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.modalFooterClasses, "data-tiger-modal-footer": "", children: footer })
166
+ ]
167
+ }
168
+ ) })
169
+ ]
170
+ }
171
+ );
172
+ return reactDom.createPortal(modalContent, document.body);
173
+ };
174
+
175
+ exports.Modal = Modal;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/CheckboxGroup.tsx
7
+ var CheckboxGroupContextProvider = react.createContext(null);
8
+ var useCheckboxGroup = () => {
9
+ return react.useContext(CheckboxGroupContextProvider);
10
+ };
11
+ var CheckboxGroup = ({
12
+ value: controlledValue,
13
+ defaultValue = [],
14
+ disabled = false,
15
+ size = "md",
16
+ onChange,
17
+ children,
18
+ className,
19
+ ...props
20
+ }) => {
21
+ const [internalValue, setInternalValue] = react.useState(defaultValue);
22
+ const isControlled = controlledValue !== void 0;
23
+ const value = isControlled ? controlledValue : internalValue;
24
+ const updateValue = (val, checked) => {
25
+ if (disabled) return;
26
+ const currentValue = [...value];
27
+ const index = currentValue.indexOf(val);
28
+ if (checked && index === -1) {
29
+ currentValue.push(val);
30
+ } else if (!checked && index !== -1) {
31
+ currentValue.splice(index, 1);
32
+ }
33
+ if (!isControlled) {
34
+ setInternalValue(currentValue);
35
+ }
36
+ onChange?.(currentValue);
37
+ };
38
+ const context = {
39
+ value,
40
+ disabled,
41
+ size,
42
+ updateValue
43
+ };
44
+ return /* @__PURE__ */ jsxRuntime.jsx(CheckboxGroupContextProvider.Provider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, className, children }) });
45
+ };
46
+
47
+ exports.CheckboxGroup = CheckboxGroup;
48
+ exports.useCheckboxGroup = useCheckboxGroup;
@@ -0,0 +1,85 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var tigercatCore = require('@expcat/tigercat-core');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ // src/components/Avatar.tsx
8
+ var Avatar = ({
9
+ size = "md",
10
+ shape = "circle",
11
+ src,
12
+ alt = "",
13
+ text,
14
+ bgColor = tigercatCore.avatarDefaultBgColor,
15
+ textColor = tigercatCore.avatarDefaultTextColor,
16
+ className,
17
+ children,
18
+ ...props
19
+ }) => {
20
+ const [imageError, setImageError] = react.useState(false);
21
+ const hasImage = Boolean(src) && !imageError;
22
+ const displayText = text ? tigercatCore.getInitials(text) : "";
23
+ const ariaLabelProp = props["aria-label"];
24
+ const ariaLabelledbyProp = props["aria-labelledby"];
25
+ const ariaHiddenProp = props["aria-hidden"];
26
+ const computedLabel = ariaLabelProp ?? (alt.trim() ? alt : void 0) ?? (text?.trim() || void 0);
27
+ const isDecorative = ariaHiddenProp === true || !computedLabel && !ariaLabelledbyProp;
28
+ const avatarClasses = tigercatCore.classNames(
29
+ tigercatCore.avatarBaseClasses,
30
+ tigercatCore.avatarSizeClasses[size],
31
+ tigercatCore.avatarShapeClasses[shape],
32
+ !hasImage && bgColor,
33
+ !hasImage && textColor,
34
+ className
35
+ );
36
+ if (hasImage) {
37
+ return /* @__PURE__ */ jsxRuntime.jsx(
38
+ "span",
39
+ {
40
+ ...props,
41
+ className: avatarClasses,
42
+ "aria-hidden": isDecorative ? true : props["aria-hidden"],
43
+ children: /* @__PURE__ */ jsxRuntime.jsx(
44
+ "img",
45
+ {
46
+ src,
47
+ alt,
48
+ className: tigercatCore.avatarImageClasses,
49
+ onError: () => setImageError(true)
50
+ }
51
+ )
52
+ }
53
+ );
54
+ }
55
+ if (displayText) {
56
+ return /* @__PURE__ */ jsxRuntime.jsx(
57
+ "span",
58
+ {
59
+ ...props,
60
+ className: avatarClasses,
61
+ ...isDecorative ? { "aria-hidden": true } : {
62
+ role: "img",
63
+ "aria-label": computedLabel,
64
+ "aria-labelledby": ariaLabelledbyProp
65
+ },
66
+ children: displayText
67
+ }
68
+ );
69
+ }
70
+ return /* @__PURE__ */ jsxRuntime.jsx(
71
+ "span",
72
+ {
73
+ ...props,
74
+ className: avatarClasses,
75
+ ...isDecorative ? { "aria-hidden": true } : {
76
+ role: "img",
77
+ "aria-label": computedLabel,
78
+ "aria-labelledby": ariaLabelledbyProp
79
+ },
80
+ children
81
+ }
82
+ );
83
+ };
84
+
85
+ exports.Avatar = Avatar;
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ var chunkTJFS44SH_js = require('./chunk-TJFS44SH.js');
4
+ var react = require('react');
5
+ var tigercatCore = require('@expcat/tigercat-core');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ var Checkbox = ({
9
+ checked: controlledChecked,
10
+ defaultChecked = false,
11
+ value,
12
+ size: propSize,
13
+ disabled: propDisabled,
14
+ indeterminate = false,
15
+ onChange,
16
+ children,
17
+ className,
18
+ ...props
19
+ }) => {
20
+ const groupContext = chunkTJFS44SH_js.useCheckboxGroup();
21
+ const [internalChecked, setInternalChecked] = react.useState(defaultChecked);
22
+ const isControlled = controlledChecked !== void 0;
23
+ const effectiveSize = propSize || groupContext?.size || "md";
24
+ const effectiveDisabled = propDisabled !== void 0 ? propDisabled : groupContext?.disabled || false;
25
+ const checked = groupContext && value !== void 0 ? groupContext.value.includes(value) : isControlled ? controlledChecked : internalChecked;
26
+ const checkboxRef = react.useRef(null);
27
+ react.useEffect(() => {
28
+ if (checkboxRef.current) {
29
+ checkboxRef.current.indeterminate = indeterminate;
30
+ }
31
+ }, [indeterminate]);
32
+ const handleChange = (event) => {
33
+ if (effectiveDisabled) return;
34
+ const newValue = event.target.checked;
35
+ if (groupContext && value !== void 0) {
36
+ groupContext.updateValue(value, newValue);
37
+ } else {
38
+ if (!isControlled) {
39
+ setInternalChecked(newValue);
40
+ }
41
+ onChange?.(newValue, event);
42
+ }
43
+ };
44
+ const checkboxClasses = tigercatCore.getCheckboxClasses(effectiveSize, effectiveDisabled);
45
+ const labelClasses = tigercatCore.classNames(
46
+ tigercatCore.getCheckboxLabelClasses(effectiveSize, effectiveDisabled),
47
+ className
48
+ );
49
+ const checkboxElement = /* @__PURE__ */ jsxRuntime.jsx(
50
+ "input",
51
+ {
52
+ ref: checkboxRef,
53
+ type: "checkbox",
54
+ className: checkboxClasses,
55
+ checked,
56
+ disabled: effectiveDisabled,
57
+ value: typeof value === "boolean" ? String(value) : value,
58
+ onChange: handleChange,
59
+ ...props
60
+ }
61
+ );
62
+ if (!children) {
63
+ return checkboxElement;
64
+ }
65
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: labelClasses, children: [
66
+ checkboxElement,
67
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2", children })
68
+ ] });
69
+ };
70
+
71
+ exports.Checkbox = Checkbox;
@@ -0,0 +1,120 @@
1
+ 'use strict';
2
+
3
+ var tigercatCore = require('@expcat/tigercat-core');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/Descriptions.tsx
7
+ var Descriptions = ({
8
+ title,
9
+ extra,
10
+ bordered = false,
11
+ column = 3,
12
+ size = "md",
13
+ layout = "horizontal",
14
+ colon = true,
15
+ labelStyle,
16
+ contentStyle,
17
+ items = [],
18
+ className,
19
+ children,
20
+ ...props
21
+ }) => {
22
+ const renderHeader = () => {
23
+ if (!title && !extra) return null;
24
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tigercatCore.descriptionsHeaderClasses, children: [
25
+ title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.descriptionsTitleClasses, children: title }) : null,
26
+ extra ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.descriptionsExtraClasses, children: extra }) : null
27
+ ] });
28
+ };
29
+ const renderRow = (rowItems, rowIndex) => {
30
+ const cells = [];
31
+ rowItems.forEach((item, itemIndex) => {
32
+ const span = Math.min(item.span || 1, column);
33
+ const labelClass = tigercatCore.classNames(
34
+ tigercatCore.getDescriptionsLabelClasses(bordered, size, layout),
35
+ item.labelClassName
36
+ );
37
+ const contentClass = tigercatCore.classNames(
38
+ tigercatCore.getDescriptionsContentClasses(bordered, size, layout),
39
+ item.contentClassName
40
+ );
41
+ const key = `${rowIndex}-${itemIndex}`;
42
+ cells.push(
43
+ /* @__PURE__ */ jsxRuntime.jsxs("th", { className: labelClass, style: labelStyle, children: [
44
+ item.label,
45
+ colon && layout === "horizontal" ? ":" : ""
46
+ ] }, `${key}-label`)
47
+ );
48
+ cells.push(
49
+ /* @__PURE__ */ jsxRuntime.jsx(
50
+ "td",
51
+ {
52
+ className: contentClass,
53
+ style: contentStyle,
54
+ colSpan: span > 1 ? span * 2 - 1 : 1,
55
+ children: item.content
56
+ },
57
+ `${key}-content`
58
+ )
59
+ );
60
+ });
61
+ return /* @__PURE__ */ jsxRuntime.jsx("tr", { children: cells }, rowIndex);
62
+ };
63
+ const renderHorizontalLayout = () => {
64
+ if (items.length === 0 && !children) {
65
+ return null;
66
+ }
67
+ const rows = tigercatCore.groupItemsIntoRows(items, column);
68
+ return /* @__PURE__ */ jsxRuntime.jsx("table", { className: tigercatCore.getDescriptionsTableClasses(bordered), children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((row, index) => renderRow(row, index)) }) });
69
+ };
70
+ const renderVerticalItem = (item, index) => {
71
+ const labelClass = tigercatCore.classNames(
72
+ tigercatCore.getDescriptionsLabelClasses(bordered, size, layout),
73
+ item.labelClassName
74
+ );
75
+ const contentClass = tigercatCore.classNames(
76
+ tigercatCore.getDescriptionsContentClasses(bordered, size, layout),
77
+ item.contentClassName
78
+ );
79
+ if (bordered) {
80
+ return /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
81
+ /* @__PURE__ */ jsxRuntime.jsxs("th", { className: labelClass, style: labelStyle, children: [
82
+ item.label,
83
+ colon ? ":" : ""
84
+ ] }),
85
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: contentClass, style: contentStyle, children: item.content })
86
+ ] }, index);
87
+ }
88
+ const itemClasses = tigercatCore.getDescriptionsVerticalItemClasses(bordered, size);
89
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: itemClasses, children: [
90
+ /* @__PURE__ */ jsxRuntime.jsxs("dt", { className: labelClass, style: labelStyle, children: [
91
+ item.label,
92
+ colon ? ":" : ""
93
+ ] }),
94
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: contentClass, style: contentStyle, children: item.content })
95
+ ] }, index);
96
+ };
97
+ const renderVerticalLayout = () => {
98
+ if (items.length === 0 && !children) {
99
+ return null;
100
+ }
101
+ if (bordered) {
102
+ return /* @__PURE__ */ jsxRuntime.jsx("table", { className: tigercatCore.getDescriptionsTableClasses(bordered), children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: items.map((item, index) => renderVerticalItem(item, index)) }) });
103
+ }
104
+ return /* @__PURE__ */ jsxRuntime.jsx("dl", { className: tigercatCore.descriptionsVerticalWrapperClasses, children: items.map((item, index) => renderVerticalItem(item, index)) });
105
+ };
106
+ const descriptionsClasses = tigercatCore.classNames(
107
+ tigercatCore.descriptionsWrapperClasses,
108
+ tigercatCore.getDescriptionsClasses(bordered, size),
109
+ className
110
+ );
111
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: descriptionsClasses, ...props, children: [
112
+ renderHeader(),
113
+ layout === "horizontal" ? renderHorizontalLayout() : renderVerticalLayout(),
114
+ children
115
+ ] });
116
+ };
117
+ var Descriptions_default = Descriptions;
118
+
119
+ exports.Descriptions = Descriptions;
120
+ exports.Descriptions_default = Descriptions_default;
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var tigercatCore = require('@expcat/tigercat-core');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/Header.tsx
7
+ var Header = ({
8
+ className,
9
+ height = "64px",
10
+ style,
11
+ children,
12
+ ...props
13
+ }) => {
14
+ const headerClasses = tigercatCore.classNames(tigercatCore.layoutHeaderClasses, className);
15
+ const headerStyle = { ...style, height };
16
+ return /* @__PURE__ */ jsxRuntime.jsx("header", { className: headerClasses, style: headerStyle, ...props, children });
17
+ };
18
+
19
+ exports.Header = Header;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var tigercatCore = require('@expcat/tigercat-core');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/components/Card.tsx
7
+ var Card = ({
8
+ variant = "default",
9
+ size = "md",
10
+ hoverable = false,
11
+ cover,
12
+ coverAlt = "Card cover image",
13
+ header,
14
+ footer,
15
+ actions,
16
+ className,
17
+ children,
18
+ ...props
19
+ }) => {
20
+ const sectionSizeClass = cover ? tigercatCore.cardSizeClasses[size] : void 0;
21
+ const cardClasses = tigercatCore.classNames(
22
+ tigercatCore.getCardClasses(variant, hoverable),
23
+ !cover && tigercatCore.cardSizeClasses[size],
24
+ className
25
+ );
26
+ const bodyClasses = tigercatCore.classNames(tigercatCore.cardBodyClasses, sectionSizeClass);
27
+ const getSectionClasses = (baseClasses) => tigercatCore.classNames(baseClasses, sectionSizeClass);
28
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cardClasses, ...props, children: [
29
+ cover && /* @__PURE__ */ jsxRuntime.jsx("div", { className: tigercatCore.cardCoverWrapperClasses, children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: cover, alt: coverAlt, className: tigercatCore.cardCoverClasses }) }),
30
+ header != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: getSectionClasses(tigercatCore.cardHeaderClasses), children: header }),
31
+ children != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: bodyClasses, children }),
32
+ footer != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: getSectionClasses(tigercatCore.cardFooterClasses), children: footer }),
33
+ actions != null && /* @__PURE__ */ jsxRuntime.jsx("div", { className: getSectionClasses(tigercatCore.classNames(tigercatCore.cardActionsClasses, tigercatCore.cardFooterClasses)), children: actions })
34
+ ] });
35
+ };
36
+
37
+ exports.Card = Card;