@ktbsh/ui 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 (153) hide show
  1. package/README.md +165 -0
  2. package/dist/custom-elements.json +1427 -0
  3. package/dist/index.d.ts +13 -0
  4. package/dist/index.js +12 -0
  5. package/dist/react/alert.d.ts +20 -0
  6. package/dist/react/alert.js +30 -0
  7. package/dist/react/badge.d.ts +17 -0
  8. package/dist/react/badge.js +30 -0
  9. package/dist/react/box.d.ts +22 -0
  10. package/dist/react/box.js +30 -0
  11. package/dist/react/breadcrumb.d.ts +17 -0
  12. package/dist/react/breadcrumb.js +30 -0
  13. package/dist/react/button.d.ts +20 -0
  14. package/dist/react/button.js +30 -0
  15. package/dist/react/checkbox.d.ts +22 -0
  16. package/dist/react/checkbox.js +30 -0
  17. package/dist/react/container.d.ts +18 -0
  18. package/dist/react/container.js +30 -0
  19. package/dist/react/field.d.ts +20 -0
  20. package/dist/react/field.js +30 -0
  21. package/dist/react/heading.d.ts +19 -0
  22. package/dist/react/heading.js +30 -0
  23. package/dist/react/input.d.ts +25 -0
  24. package/dist/react/input.js +30 -0
  25. package/dist/react/label.d.ts +18 -0
  26. package/dist/react/label.js +30 -0
  27. package/dist/react/link.d.ts +21 -0
  28. package/dist/react/link.js +30 -0
  29. package/dist/react/modal.d.ts +18 -0
  30. package/dist/react/modal.js +30 -0
  31. package/dist/react/nav.d.ts +17 -0
  32. package/dist/react/nav.js +30 -0
  33. package/dist/react/pagination.d.ts +19 -0
  34. package/dist/react/pagination.js +30 -0
  35. package/dist/react/progress.d.ts +19 -0
  36. package/dist/react/progress.js +30 -0
  37. package/dist/react/radio.d.ts +22 -0
  38. package/dist/react/radio.js +30 -0
  39. package/dist/react/select.d.ts +22 -0
  40. package/dist/react/select.js +30 -0
  41. package/dist/react/skeleton.d.ts +19 -0
  42. package/dist/react/skeleton.js +30 -0
  43. package/dist/react/spinner.d.ts +18 -0
  44. package/dist/react/spinner.js +30 -0
  45. package/dist/react/stack.d.ts +21 -0
  46. package/dist/react/stack.js +30 -0
  47. package/dist/react/switch.d.ts +21 -0
  48. package/dist/react/switch.js +30 -0
  49. package/dist/react/tab-panel.d.ts +18 -0
  50. package/dist/react/tab-panel.js +30 -0
  51. package/dist/react/tab.d.ts +19 -0
  52. package/dist/react/tab.js +30 -0
  53. package/dist/react/tabs.d.ts +17 -0
  54. package/dist/react/tabs.js +30 -0
  55. package/dist/react/text.d.ts +19 -0
  56. package/dist/react/text.js +30 -0
  57. package/dist/react/textarea.d.ts +24 -0
  58. package/dist/react/textarea.js +30 -0
  59. package/dist/react/toast.d.ts +19 -0
  60. package/dist/react/toast.js +30 -0
  61. package/dist/themes/dark.css +52 -0
  62. package/dist/themes/light.css +53 -0
  63. package/dist/tokens/index.d.ts +7 -0
  64. package/dist/tokens/index.js +7 -0
  65. package/dist/tokens/semantic.d.ts +209 -0
  66. package/dist/tokens/semantic.js +102 -0
  67. package/dist/types/index.d.ts +15 -0
  68. package/dist/types/index.js +2 -0
  69. package/dist/vanilla/alert.d.ts +2 -0
  70. package/dist/vanilla/alert.js +134 -0
  71. package/dist/vanilla/alert.src.js +257 -0
  72. package/dist/vanilla/badge.d.ts +2 -0
  73. package/dist/vanilla/badge.js +89 -0
  74. package/dist/vanilla/badge.src.js +212 -0
  75. package/dist/vanilla/box.d.ts +2 -0
  76. package/dist/vanilla/box.js +100 -0
  77. package/dist/vanilla/box.src.js +270 -0
  78. package/dist/vanilla/breadcrumb.d.ts +2 -0
  79. package/dist/vanilla/breadcrumb.js +93 -0
  80. package/dist/vanilla/breadcrumb.src.js +255 -0
  81. package/dist/vanilla/button.d.ts +2 -0
  82. package/dist/vanilla/button.js +135 -0
  83. package/dist/vanilla/button.src.js +260 -0
  84. package/dist/vanilla/checkbox.d.ts +2 -0
  85. package/dist/vanilla/checkbox.js +96 -0
  86. package/dist/vanilla/checkbox.src.js +296 -0
  87. package/dist/vanilla/container.d.ts +2 -0
  88. package/dist/vanilla/container.js +79 -0
  89. package/dist/vanilla/container.src.js +222 -0
  90. package/dist/vanilla/field.d.ts +2 -0
  91. package/dist/vanilla/field.js +113 -0
  92. package/dist/vanilla/field.src.js +278 -0
  93. package/dist/vanilla/heading.d.ts +2 -0
  94. package/dist/vanilla/heading.js +75 -0
  95. package/dist/vanilla/heading.src.js +241 -0
  96. package/dist/vanilla/input.d.ts +2 -0
  97. package/dist/vanilla/input.js +121 -0
  98. package/dist/vanilla/input.src.js +326 -0
  99. package/dist/vanilla/label.d.ts +2 -0
  100. package/dist/vanilla/label.js +75 -0
  101. package/dist/vanilla/label.src.js +232 -0
  102. package/dist/vanilla/link.d.ts +2 -0
  103. package/dist/vanilla/link.js +96 -0
  104. package/dist/vanilla/link.src.js +272 -0
  105. package/dist/vanilla/modal.d.ts +2 -0
  106. package/dist/vanilla/modal.js +125 -0
  107. package/dist/vanilla/modal.src.js +251 -0
  108. package/dist/vanilla/nav.d.ts +2 -0
  109. package/dist/vanilla/nav.js +94 -0
  110. package/dist/vanilla/nav.src.js +214 -0
  111. package/dist/vanilla/pagination.d.ts +2 -0
  112. package/dist/vanilla/pagination.js +114 -0
  113. package/dist/vanilla/pagination.src.js +262 -0
  114. package/dist/vanilla/progress.d.ts +2 -0
  115. package/dist/vanilla/progress.js +108 -0
  116. package/dist/vanilla/progress.src.js +244 -0
  117. package/dist/vanilla/radio.d.ts +2 -0
  118. package/dist/vanilla/radio.js +104 -0
  119. package/dist/vanilla/radio.src.js +326 -0
  120. package/dist/vanilla/select.d.ts +2 -0
  121. package/dist/vanilla/select.js +104 -0
  122. package/dist/vanilla/select.src.js +332 -0
  123. package/dist/vanilla/skeleton.d.ts +2 -0
  124. package/dist/vanilla/skeleton.js +99 -0
  125. package/dist/vanilla/skeleton.src.js +240 -0
  126. package/dist/vanilla/spinner.d.ts +2 -0
  127. package/dist/vanilla/spinner.js +108 -0
  128. package/dist/vanilla/spinner.src.js +222 -0
  129. package/dist/vanilla/stack.d.ts +2 -0
  130. package/dist/vanilla/stack.js +83 -0
  131. package/dist/vanilla/stack.src.js +259 -0
  132. package/dist/vanilla/switch.d.ts +2 -0
  133. package/dist/vanilla/switch.js +166 -0
  134. package/dist/vanilla/switch.src.js +299 -0
  135. package/dist/vanilla/tab-panel.d.ts +2 -0
  136. package/dist/vanilla/tab-panel.js +80 -0
  137. package/dist/vanilla/tab-panel.src.js +227 -0
  138. package/dist/vanilla/tab.d.ts +2 -0
  139. package/dist/vanilla/tab.js +99 -0
  140. package/dist/vanilla/tab.src.js +253 -0
  141. package/dist/vanilla/tabs.d.ts +2 -0
  142. package/dist/vanilla/tabs.js +66 -0
  143. package/dist/vanilla/tabs.src.js +237 -0
  144. package/dist/vanilla/text.d.ts +2 -0
  145. package/dist/vanilla/text.js +74 -0
  146. package/dist/vanilla/text.src.js +232 -0
  147. package/dist/vanilla/textarea.d.ts +2 -0
  148. package/dist/vanilla/textarea.js +97 -0
  149. package/dist/vanilla/textarea.src.js +316 -0
  150. package/dist/vanilla/toast.d.ts +2 -0
  151. package/dist/vanilla/toast.js +120 -0
  152. package/dist/vanilla/toast.src.js +245 -0
  153. package/package.json +111 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Public package entry for `@ktbsh/ui`.
3
+ *
4
+ * Components are **side-effect imports** (custom element registration):
5
+ * import '@ktbsh/ui/vanilla/button'
6
+ * import { KitbashButton } from '@ktbsh/ui/react/button'
7
+ *
8
+ * Theme CSS (load once in the app shell):
9
+ * import '@ktbsh/ui/themes/light.css'
10
+ * import '@ktbsh/ui/themes/dark.css'
11
+ */
12
+ export { applyTheme, cssVar, cssVarName, getTheme, type KitbashTheme, type SemanticTokenName, semanticTokens, type TokenValue, } from './tokens/index.ts';
13
+ export type { KitbashBadgeTone, KitbashButtonVariant, KitbashContainerWidth, KitbashFeedbackTone, KitbashHeadingLevel, KitbashLinkTone, KitbashSize, KitbashSkeletonVariant, KitbashSpace, KitbashStackAlign, KitbashStackDirection, KitbashStackJustify, KitbashTextTone, } from './types/index.ts';
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Public package entry for `@ktbsh/ui`.
3
+ *
4
+ * Components are **side-effect imports** (custom element registration):
5
+ * import '@ktbsh/ui/vanilla/button'
6
+ * import { KitbashButton } from '@ktbsh/ui/react/button'
7
+ *
8
+ * Theme CSS (load once in the app shell):
9
+ * import '@ktbsh/ui/themes/light.css'
10
+ * import '@ktbsh/ui/themes/dark.css'
11
+ */
12
+ export { applyTheme, cssVar, cssVarName, getTheme, semanticTokens, } from "./tokens/index.js";
@@ -0,0 +1,20 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashAlertProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'tone'?: string;
6
+ 'title'?: string;
7
+ 'open'?: boolean;
8
+ 'dismissible'?: boolean;
9
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
10
+ }
11
+
12
+ declare global {
13
+ namespace JSX {
14
+ interface IntrinsicElements {
15
+ 'kitbash-alert': KitbashAlertProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
16
+ }
17
+ }
18
+ }
19
+
20
+ export declare const KitbashAlert: React.ForwardRefExoticComponent<KitbashAlertProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/alert.js';
4
+
5
+ export const KitbashAlert = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-alert', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,17 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashBadgeProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'tone'?: string;
6
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
7
+ }
8
+
9
+ declare global {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ 'kitbash-badge': KitbashBadgeProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+
17
+ export declare const KitbashBadge: React.ForwardRefExoticComponent<KitbashBadgeProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/badge.js';
4
+
5
+ export const KitbashBadge = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-badge', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,22 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashBoxProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'padding'?: string;
6
+ 'paddingX'?: string;
7
+ 'paddingY'?: string;
8
+ 'radius'?: string;
9
+ 'border'?: boolean;
10
+ 'surface'?: boolean;
11
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
12
+ }
13
+
14
+ declare global {
15
+ namespace JSX {
16
+ interface IntrinsicElements {
17
+ 'kitbash-box': KitbashBoxProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
18
+ }
19
+ }
20
+ }
21
+
22
+ export declare const KitbashBox: React.ForwardRefExoticComponent<KitbashBoxProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/box.js';
4
+
5
+ export const KitbashBox = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-box', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,17 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashBreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'label'?: string;
6
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
7
+ }
8
+
9
+ declare global {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ 'kitbash-breadcrumb': KitbashBreadcrumbProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
13
+ }
14
+ }
15
+ }
16
+
17
+ export declare const KitbashBreadcrumb: React.ForwardRefExoticComponent<KitbashBreadcrumbProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/breadcrumb.js';
4
+
5
+ export const KitbashBreadcrumb = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-breadcrumb', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,20 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashButtonProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'variant'?: string;
6
+ 'size'?: string;
7
+ 'disabled'?: boolean;
8
+ 'type'?: string;
9
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
10
+ }
11
+
12
+ declare global {
13
+ namespace JSX {
14
+ interface IntrinsicElements {
15
+ 'kitbash-button': KitbashButtonProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
16
+ }
17
+ }
18
+ }
19
+
20
+ export declare const KitbashButton: React.ForwardRefExoticComponent<KitbashButtonProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/button.js';
4
+
5
+ export const KitbashButton = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-button', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,22 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashCheckboxProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'name'?: string;
6
+ 'value'?: string;
7
+ 'checked'?: boolean;
8
+ 'disabled'?: boolean;
9
+ 'required'?: boolean;
10
+ 'invalid'?: boolean;
11
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
12
+ }
13
+
14
+ declare global {
15
+ namespace JSX {
16
+ interface IntrinsicElements {
17
+ 'kitbash-checkbox': KitbashCheckboxProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
18
+ }
19
+ }
20
+ }
21
+
22
+ export declare const KitbashCheckbox: React.ForwardRefExoticComponent<KitbashCheckboxProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/checkbox.js';
4
+
5
+ export const KitbashCheckbox = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-checkbox', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,18 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashContainerProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'width'?: string;
6
+ 'padding'?: string;
7
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
8
+ }
9
+
10
+ declare global {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ 'kitbash-container': KitbashContainerProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
14
+ }
15
+ }
16
+ }
17
+
18
+ export declare const KitbashContainer: React.ForwardRefExoticComponent<KitbashContainerProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/container.js';
4
+
5
+ export const KitbashContainer = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-container', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,20 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashFieldProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'label'?: string;
6
+ 'hint'?: string;
7
+ 'error'?: string;
8
+ 'required'?: boolean;
9
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
10
+ }
11
+
12
+ declare global {
13
+ namespace JSX {
14
+ interface IntrinsicElements {
15
+ 'kitbash-field': KitbashFieldProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
16
+ }
17
+ }
18
+ }
19
+
20
+ export declare const KitbashField: React.ForwardRefExoticComponent<KitbashFieldProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/field.js';
4
+
5
+ export const KitbashField = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-field', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,19 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashHeadingProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'level'?: string;
6
+ 'size'?: string;
7
+ 'tone'?: string;
8
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
9
+ }
10
+
11
+ declare global {
12
+ namespace JSX {
13
+ interface IntrinsicElements {
14
+ 'kitbash-heading': KitbashHeadingProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
15
+ }
16
+ }
17
+ }
18
+
19
+ export declare const KitbashHeading: React.ForwardRefExoticComponent<KitbashHeadingProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/heading.js';
4
+
5
+ export const KitbashHeading = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-heading', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,25 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashInputProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'name'?: string;
6
+ 'value'?: string;
7
+ 'placeholder'?: string;
8
+ 'type'?: string;
9
+ 'required'?: boolean;
10
+ 'invalid'?: boolean;
11
+ 'disabled'?: boolean;
12
+ 'readonly'?: boolean;
13
+ 'size'?: string;
14
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
15
+ }
16
+
17
+ declare global {
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ 'kitbash-input': KitbashInputProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
21
+ }
22
+ }
23
+ }
24
+
25
+ export declare const KitbashInput: React.ForwardRefExoticComponent<KitbashInputProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/input.js';
4
+
5
+ export const KitbashInput = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-input', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,18 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashLabelProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'for'?: string;
6
+ 'required'?: boolean;
7
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
8
+ }
9
+
10
+ declare global {
11
+ namespace JSX {
12
+ interface IntrinsicElements {
13
+ 'kitbash-label': KitbashLabelProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
14
+ }
15
+ }
16
+ }
17
+
18
+ export declare const KitbashLabel: React.ForwardRefExoticComponent<KitbashLabelProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/label.js';
4
+
5
+ export const KitbashLabel = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-label', { ref: setRefs, ...props }, children);
30
+ });
@@ -0,0 +1,21 @@
1
+
2
+ import * as React from 'react';
3
+
4
+ export interface KitbashLinkProps extends React.HTMLAttributes<HTMLElement> {
5
+ 'href'?: string;
6
+ 'target'?: string;
7
+ 'rel'?: string;
8
+ 'tone'?: string;
9
+ 'disabled'?: boolean;
10
+ onKitbashChange?: (event: CustomEvent<{ props: Record<string, unknown>; state: Record<string, unknown> }>) => void;
11
+ }
12
+
13
+ declare global {
14
+ namespace JSX {
15
+ interface IntrinsicElements {
16
+ 'kitbash-link': KitbashLinkProps & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
17
+ }
18
+ }
19
+ }
20
+
21
+ export declare const KitbashLink: React.ForwardRefExoticComponent<KitbashLinkProps & React.RefAttributes<HTMLElement>>;
@@ -0,0 +1,30 @@
1
+
2
+ import * as React from 'react';
3
+ import '../vanilla/link.js';
4
+
5
+ export const KitbashLink = React.forwardRef(({ children, onKitbashChange, ...props }, ref) => {
6
+ const innerRef = React.useRef(null);
7
+
8
+ // kitbash-change is a CustomEvent — bridge manually. Native events (onClick, etc.)
9
+ // stay on ...props so React 19 binds them once (no double-fire).
10
+ React.useEffect(() => {
11
+ const el = innerRef.current;
12
+ if (!el || !onKitbashChange) return;
13
+
14
+ const handleCustomChange = (e) => onKitbashChange(e);
15
+ el.addEventListener('kitbash-change', handleCustomChange);
16
+ return () => el.removeEventListener('kitbash-change', handleCustomChange);
17
+ }, [onKitbashChange]);
18
+
19
+ // Callback ref: assign + clear on unmount / ref change (object + function refs).
20
+ const setRefs = React.useCallback((node) => {
21
+ innerRef.current = node;
22
+ if (typeof ref === 'function') {
23
+ ref(node);
24
+ } else if (ref && typeof ref === 'object') {
25
+ ref.current = node;
26
+ }
27
+ }, [ref]);
28
+
29
+ return React.createElement('kitbash-link', { ref: setRefs, ...props }, children);
30
+ });