@expcat/tigercat-react 0.0.65 → 0.0.67

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/styles/index.css +4 -0
  2. package/dist/styles/index.d.mts +2 -0
  3. package/package.json +12 -9
  4. package/dist/chunk-2DOPHSZP.js +0 -32
  5. package/dist/chunk-2TS6X5RA.js +0 -73
  6. package/dist/chunk-2Y327ZU4.js +0 -493
  7. package/dist/chunk-3OF7XPIQ.js +0 -90
  8. package/dist/chunk-3WPKVV4N.js +0 -140
  9. package/dist/chunk-5FRENLDC.js +0 -194
  10. package/dist/chunk-5QKMQRCW.js +0 -89
  11. package/dist/chunk-5ZVSFIZD.js +0 -50
  12. package/dist/chunk-6MGEGOYJ.js +0 -108
  13. package/dist/chunk-6PUSRC6S.js +0 -68
  14. package/dist/chunk-72ZRDBXN.js +0 -25
  15. package/dist/chunk-77D7VQMG.js +0 -43
  16. package/dist/chunk-7P6PHSFM.js +0 -548
  17. package/dist/chunk-AG6GVQ5O.js +0 -271
  18. package/dist/chunk-AQ6DHCP6.js +0 -53
  19. package/dist/chunk-AQQRWISY.js +0 -184
  20. package/dist/chunk-C5EFBJBR.js +0 -540
  21. package/dist/chunk-D3I2SY7X.js +0 -301
  22. package/dist/chunk-DZJUFU55.js +0 -300
  23. package/dist/chunk-EI2GHMQS.js +0 -37
  24. package/dist/chunk-ENR3RIMM.js +0 -205
  25. package/dist/chunk-EQWQXURG.js +0 -18
  26. package/dist/chunk-EUHWE7MN.js +0 -267
  27. package/dist/chunk-FAKTU64M.js +0 -67
  28. package/dist/chunk-FQ6UHRAO.js +0 -499
  29. package/dist/chunk-GX74TC62.js +0 -54
  30. package/dist/chunk-HDDBBZQH.js +0 -321
  31. package/dist/chunk-IFY46RWU.js +0 -25
  32. package/dist/chunk-IQINYCU6.js +0 -99
  33. package/dist/chunk-IY4LEJYF.js +0 -78
  34. package/dist/chunk-JW64IJP2.js +0 -210
  35. package/dist/chunk-KUCFT2OA.js +0 -43
  36. package/dist/chunk-LNKI6HQ3.js +0 -152
  37. package/dist/chunk-LXA2YBAO.js +0 -38
  38. package/dist/chunk-MKWXJZ3T.js +0 -74
  39. package/dist/chunk-NEULKOYJ.js +0 -48
  40. package/dist/chunk-NI2WNZRT.js +0 -38
  41. package/dist/chunk-OFCKGWTS.js +0 -12
  42. package/dist/chunk-OTRGVENC.js +0 -305
  43. package/dist/chunk-P273E6XE.js +0 -219
  44. package/dist/chunk-Q3DPJHNM.js +0 -407
  45. package/dist/chunk-QFVE7GKD.js +0 -109
  46. package/dist/chunk-QL6OBKEN.js +0 -84
  47. package/dist/chunk-QL6UEG3U.js +0 -27
  48. package/dist/chunk-QORSSZX4.js +0 -144
  49. package/dist/chunk-R4JSBXGG.js +0 -12
  50. package/dist/chunk-R5BQHZWB.js +0 -698
  51. package/dist/chunk-R7MS42PL.js +0 -90
  52. package/dist/chunk-TB2UHDOZ.js +0 -19
  53. package/dist/chunk-TBIEWDY5.js +0 -175
  54. package/dist/chunk-TJFS44SH.js +0 -48
  55. package/dist/chunk-TZ26HQAW.js +0 -85
  56. package/dist/chunk-U4ZVEPYD.js +0 -71
  57. package/dist/chunk-UFAXJVMD.js +0 -120
  58. package/dist/chunk-VJJ76I7U.js +0 -19
  59. package/dist/chunk-VO4WDK4K.js +0 -37
  60. package/dist/chunk-VSF4DF7N.js +0 -84
  61. package/dist/chunk-VVO4V4IK.js +0 -56
  62. package/dist/chunk-WK5HN4OH.js +0 -113
  63. package/dist/chunk-XZDJ5FRB.js +0 -333
  64. package/dist/chunk-YE2M2HNM.js +0 -168
  65. package/dist/chunk-YYGTJKP5.js +0 -39
  66. package/dist/chunk-ZREFCRX3.js +0 -52
  67. package/dist/components/Alert.d.ts +0 -24
  68. package/dist/components/Alert.js +0 -10
  69. package/dist/components/Avatar.d.ts +0 -12
  70. package/dist/components/Avatar.js +0 -10
  71. package/dist/components/Badge.d.ts +0 -12
  72. package/dist/components/Badge.js +0 -10
  73. package/dist/components/Breadcrumb.d.ts +0 -13
  74. package/dist/components/Breadcrumb.js +0 -14
  75. package/dist/components/BreadcrumbItem.d.ts +0 -21
  76. package/dist/components/BreadcrumbItem.js +0 -11
  77. package/dist/components/Button.d.ts +0 -8
  78. package/dist/components/Button.js +0 -10
  79. package/dist/components/Card.d.ts +0 -33
  80. package/dist/components/Card.js +0 -10
  81. package/dist/components/Checkbox.d.ts +0 -48
  82. package/dist/components/Checkbox.js +0 -11
  83. package/dist/components/CheckboxGroup.d.ts +0 -39
  84. package/dist/components/CheckboxGroup.js +0 -14
  85. package/dist/components/Code.d.ts +0 -9
  86. package/dist/components/Code.js +0 -16
  87. package/dist/components/Col.d.ts +0 -7
  88. package/dist/components/Col.js +0 -11
  89. package/dist/components/ConfigProvider.d.ts +0 -14
  90. package/dist/components/ConfigProvider.js +0 -14
  91. package/dist/components/Container.d.ts +0 -13
  92. package/dist/components/Container.js +0 -10
  93. package/dist/components/Content.d.ts +0 -9
  94. package/dist/components/Content.js +0 -10
  95. package/dist/components/DatePicker.d.ts +0 -24
  96. package/dist/components/DatePicker.js +0 -10
  97. package/dist/components/Descriptions.d.ts +0 -53
  98. package/dist/components/Descriptions.js +0 -16
  99. package/dist/components/Divider.d.ts +0 -12
  100. package/dist/components/Divider.js +0 -10
  101. package/dist/components/Drawer.d.ts +0 -19
  102. package/dist/components/Drawer.js +0 -11
  103. package/dist/components/Dropdown.d.ts +0 -22
  104. package/dist/components/Dropdown.js +0 -16
  105. package/dist/components/DropdownItem.d.ts +0 -17
  106. package/dist/components/DropdownItem.js +0 -13
  107. package/dist/components/DropdownMenu.d.ts +0 -13
  108. package/dist/components/DropdownMenu.js +0 -10
  109. package/dist/components/Footer.d.ts +0 -9
  110. package/dist/components/Footer.js +0 -10
  111. package/dist/components/Form.d.ts +0 -56
  112. package/dist/components/Form.js +0 -14
  113. package/dist/components/FormItem.d.ts +0 -16
  114. package/dist/components/FormItem.js +0 -11
  115. package/dist/components/Header.d.ts +0 -9
  116. package/dist/components/Header.js +0 -10
  117. package/dist/components/Icon.d.ts +0 -9
  118. package/dist/components/Icon.js +0 -10
  119. package/dist/components/Input.d.ts +0 -28
  120. package/dist/components/Input.js +0 -10
  121. package/dist/components/Layout.d.ts +0 -9
  122. package/dist/components/Layout.js +0 -10
  123. package/dist/components/Link.d.ts +0 -10
  124. package/dist/components/Link.js +0 -10
  125. package/dist/components/List.d.ts +0 -94
  126. package/dist/components/List.js +0 -12
  127. package/dist/components/Loading.d.ts +0 -8
  128. package/dist/components/Loading.js +0 -10
  129. package/dist/components/Menu.d.ts +0 -35
  130. package/dist/components/Menu.js +0 -14
  131. package/dist/components/MenuItem.d.ts +0 -20
  132. package/dist/components/MenuItem.js +0 -11
  133. package/dist/components/MenuItemGroup.d.ts +0 -16
  134. package/dist/components/MenuItemGroup.js +0 -12
  135. package/dist/components/Message.d.ts +0 -44
  136. package/dist/components/Message.js +0 -20
  137. package/dist/components/Modal.d.ts +0 -41
  138. package/dist/components/Modal.js +0 -11
  139. package/dist/components/Notification.d.ts +0 -40
  140. package/dist/components/Notification.js +0 -20
  141. package/dist/components/Pagination.d.ts +0 -11
  142. package/dist/components/Pagination.js +0 -16
  143. package/dist/components/Popconfirm.d.ts +0 -34
  144. package/dist/components/Popconfirm.js +0 -10
  145. package/dist/components/Popover.d.ts +0 -14
  146. package/dist/components/Popover.js +0 -10
  147. package/dist/components/Progress.d.ts +0 -8
  148. package/dist/components/Progress.js +0 -10
  149. package/dist/components/Radio.d.ts +0 -20
  150. package/dist/components/Radio.js +0 -11
  151. package/dist/components/RadioGroup.d.ts +0 -28
  152. package/dist/components/RadioGroup.js +0 -14
  153. package/dist/components/Row.d.ts +0 -11
  154. package/dist/components/Row.js +0 -14
  155. package/dist/components/Select.d.ts +0 -23
  156. package/dist/components/Select.js +0 -10
  157. package/dist/components/Sidebar.d.ts +0 -9
  158. package/dist/components/Sidebar.js +0 -10
  159. package/dist/components/Skeleton.d.ts +0 -7
  160. package/dist/components/Skeleton.js +0 -10
  161. package/dist/components/Slider.d.ts +0 -12
  162. package/dist/components/Slider.js +0 -10
  163. package/dist/components/Space.d.ts +0 -11
  164. package/dist/components/Space.js +0 -10
  165. package/dist/components/Steps.d.ts +0 -31
  166. package/dist/components/Steps.js +0 -14
  167. package/dist/components/StepsItem.d.ts +0 -36
  168. package/dist/components/StepsItem.js +0 -10
  169. package/dist/components/SubMenu.d.ts +0 -20
  170. package/dist/components/SubMenu.js +0 -13
  171. package/dist/components/Switch.d.ts +0 -12
  172. package/dist/components/Switch.js +0 -10
  173. package/dist/components/TabPane.d.ts +0 -42
  174. package/dist/components/TabPane.js +0 -10
  175. package/dist/components/Table.d.ts +0 -46
  176. package/dist/components/Table.js +0 -10
  177. package/dist/components/Tabs.d.ts +0 -43
  178. package/dist/components/Tabs.js +0 -14
  179. package/dist/components/Tag.d.ts +0 -16
  180. package/dist/components/Tag.js +0 -10
  181. package/dist/components/Text.d.ts +0 -9
  182. package/dist/components/Text.js +0 -10
  183. package/dist/components/Textarea.d.ts +0 -13
  184. package/dist/components/Textarea.js +0 -10
  185. package/dist/components/TimePicker.d.ts +0 -28
  186. package/dist/components/TimePicker.js +0 -10
  187. package/dist/components/Timeline.d.ts +0 -47
  188. package/dist/components/Timeline.js +0 -10
  189. package/dist/components/Tooltip.d.ts +0 -15
  190. package/dist/components/Tooltip.js +0 -10
  191. package/dist/components/Tree.d.ts +0 -154
  192. package/dist/components/Tree.js +0 -16
  193. package/dist/components/Upload.d.ts +0 -16
  194. package/dist/components/Upload.js +0 -11
  195. package/dist/index.d.ts +0 -77
  196. package/dist/index.js +0 -364
@@ -1,90 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;
@@ -1,175 +0,0 @@
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;
@@ -1,48 +0,0 @@
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;
@@ -1,85 +0,0 @@
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;
@@ -1,71 +0,0 @@
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;
@@ -1,120 +0,0 @@
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;
@@ -1,19 +0,0 @@
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;
@@ -1,37 +0,0 @@
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;