@ikonai/sdk-react-ui-standard 1.0.7

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 (36) hide show
  1. package/components/radix-accessibility.d.ts +3 -0
  2. package/components/radix-action-button.d.ts +2 -0
  3. package/components/radix-button.d.ts +2 -0
  4. package/components/radix-capture-button.d.ts +2 -0
  5. package/components/radix-dialog.d.ts +2 -0
  6. package/components/radix-disclosure.d.ts +10 -0
  7. package/components/radix-display.d.ts +11 -0
  8. package/components/radix-dnd.d.ts +7 -0
  9. package/components/radix-file-upload-zone.d.ts +2 -0
  10. package/components/radix-file-upload.d.ts +2 -0
  11. package/components/radix-form-system.d.ts +8 -0
  12. package/components/radix-form.d.ts +31 -0
  13. package/components/radix-heading.d.ts +2 -0
  14. package/components/radix-icon-button.d.ts +2 -0
  15. package/components/radix-icon.d.ts +2 -0
  16. package/components/radix-layout.d.ts +8 -0
  17. package/components/radix-markdown.d.ts +2 -0
  18. package/components/radix-navigation.d.ts +29 -0
  19. package/components/radix-otp-password.d.ts +7 -0
  20. package/components/radix-overlay-primitives.d.ts +40 -0
  21. package/components/radix-popover.d.ts +2 -0
  22. package/components/radix-tabs.d.ts +5 -0
  23. package/components/radix-text-area.d.ts +2 -0
  24. package/components/radix-text-field.d.ts +2 -0
  25. package/components/radix-text.d.ts +2 -0
  26. package/components/radix-theme.d.ts +2 -0
  27. package/components/radix-tooltip.d.ts +2 -0
  28. package/icons/icon-registry.d.ts +17 -0
  29. package/icons/index.d.ts +2 -0
  30. package/icons/lucide-icons.d.ts +2 -0
  31. package/index.d.ts +29 -0
  32. package/index.js +52875 -0
  33. package/package.json +56 -0
  34. package/radix-core.d.ts +67 -0
  35. package/radix-module.d.ts +5 -0
  36. package/utils/file-upload.d.ts +61 -0
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@ikonai/sdk-react-ui-standard",
3
+ "version": "1.0.7",
4
+ "type": "module",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "import": "./index.js",
11
+ "types": "./index.d.ts"
12
+ }
13
+ },
14
+ "peerDependencies": {
15
+ "@ikonai/sdk-react-ui": "*",
16
+ "lucide-react": "*",
17
+ "@dnd-kit/core": "*",
18
+ "@dnd-kit/sortable": "*",
19
+ "@dnd-kit/utilities": "*",
20
+ "@radix-ui/react-accessible-icon": "*",
21
+ "@radix-ui/react-accordion": "*",
22
+ "@radix-ui/react-alert-dialog": "*",
23
+ "@radix-ui/react-aspect-ratio": "*",
24
+ "@radix-ui/react-avatar": "*",
25
+ "@radix-ui/react-checkbox": "*",
26
+ "@radix-ui/react-collapsible": "*",
27
+ "@radix-ui/react-dialog": "*",
28
+ "@radix-ui/react-direction": "*",
29
+ "@radix-ui/react-form": "*",
30
+ "@radix-ui/react-hover-card": "*",
31
+ "@radix-ui/react-menubar": "*",
32
+ "@radix-ui/react-navigation-menu": "*",
33
+ "@radix-ui/react-popover": "*",
34
+ "@radix-ui/react-portal": "*",
35
+ "@radix-ui/react-progress": "*",
36
+ "@radix-ui/react-radio-group": "*",
37
+ "@radix-ui/react-scroll-area": "*",
38
+ "@radix-ui/react-select": "*",
39
+ "@radix-ui/react-separator": "*",
40
+ "@radix-ui/react-slider": "*",
41
+ "@radix-ui/react-switch": "*",
42
+ "@radix-ui/react-tabs": "*",
43
+ "@radix-ui/react-toast": "*",
44
+ "@radix-ui/react-toggle": "*",
45
+ "@radix-ui/react-toggle-group": "*",
46
+ "@radix-ui/react-toolbar": "*",
47
+ "@radix-ui/react-tooltip": "*",
48
+ "@radix-ui/react-primitive": "*",
49
+ "@radix-ui/react-visually-hidden": "*",
50
+ "react": "*",
51
+ "react-dom": "*",
52
+ "react-markdown": "*",
53
+ "rehype-external-links": "*",
54
+ "remark-gfm": "*"
55
+ }
56
+ }
@@ -0,0 +1,67 @@
1
+ import { UiComponentRendererProps, UiNode, UiNodeProps, UiRenderContext } from '../../sdk-react-ui/src/index.ts';
2
+ export declare const RESET_BUTTON_CLASS = "ikon-reset-button";
3
+ export declare const RESET_INPUT_CLASS = "ikon-reset-input";
4
+ export declare const RESET_FOCUS_CLASS = "ikon-reset-focus";
5
+ export declare function hasAnyKeys(obj: Record<string, unknown>): boolean;
6
+ export declare const TEXT_FIELD_EXCLUDE_KEYS: Set<string>;
7
+ export declare const TEXT_AREA_EXCLUDE_KEYS: Set<string>;
8
+ export declare const CHECKBOX_EXCLUDE_KEYS: Set<string>;
9
+ export declare const SWITCH_EXCLUDE_KEYS: Set<string>;
10
+ export declare const RADIO_GROUP_EXCLUDE_KEYS: Set<string>;
11
+ export declare const TOGGLE_EXCLUDE_KEYS: Set<string>;
12
+ export declare const SLIDER_EXCLUDE_KEYS: Set<string>;
13
+ export declare const SELECT_EXCLUDE_KEYS: Set<string>;
14
+ export declare const BUTTON_EXCLUDE_KEYS: Set<string>;
15
+ export declare const ICON_BUTTON_EXCLUDE_KEYS: Set<string>;
16
+ export declare const EMPTY_EXCLUDE_SET: Set<string>;
17
+ export declare function toStringValue(value: unknown): string | undefined;
18
+ export declare function toBooleanValue(value: unknown): boolean | undefined;
19
+ export declare function toNumberValue(value: unknown): number | undefined;
20
+ export declare function toActionId(value: unknown): string | undefined;
21
+ export declare function combineClassNames(...candidates: (string | readonly string[] | undefined)[]): string | undefined;
22
+ export declare function pickPrimitiveProps(props: UiNodeProps | undefined, exclude?: Set<string>): Record<string, unknown>;
23
+ export declare function createVoidDispatcher(actionId: string | undefined, dispatch: UiComponentRendererProps['context']['dispatchAction']): (() => void) | undefined;
24
+ export declare function createCachedVoidDispatcher(nodeId: string, actionId: string | undefined, context: UiRenderContext): (() => void) | undefined;
25
+ export declare function createStringDispatcher(actionId: string | undefined, dispatch: UiComponentRendererProps['context']['dispatchAction']): ((value: string) => void) | undefined;
26
+ export declare function createCachedStringDispatcher(nodeId: string, actionId: string | undefined, context: UiRenderContext): ((value: string) => void) | undefined;
27
+ export declare function createNullableBooleanDispatcher(actionId: string | undefined, dispatch: UiComponentRendererProps['context']['dispatchAction']): ((value: boolean | null | undefined) => void) | undefined;
28
+ export declare function createCachedNullableBooleanDispatcher(nodeId: string, actionId: string | undefined, context: UiRenderContext): ((value: boolean | null | undefined) => void) | undefined;
29
+ export declare function toStringListValue(value: unknown): string[] | undefined;
30
+ export declare function toStyleIdList(value: unknown): readonly string[] | undefined;
31
+ export interface SlotChildCollection {
32
+ readonly defaultChildren: readonly UiNode[];
33
+ readonly slotChildren: ReadonlyMap<string, readonly UiNode[]>;
34
+ }
35
+ export declare function collectSlotChildren(node: UiNode): SlotChildCollection;
36
+ /**
37
+ * Hook for managing controlled/uncontrolled component state.
38
+ * Reduces boilerplate in form components that support both controlled and uncontrolled modes.
39
+ *
40
+ * @param controlledValue - The controlled value (undefined means uncontrolled)
41
+ * @param defaultValue - The default value for uncontrolled mode
42
+ * @param onChange - Optional callback when value changes
43
+ * @returns Tuple of [currentValue, setValue] for use in the component
44
+ */
45
+ export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void): [T, (value: T) => void];
46
+ /**
47
+ * Hook for optimistic UI state updates.
48
+ * Provides immediate visual feedback when users interact with controlled components,
49
+ * while the server state remains the source of truth.
50
+ *
51
+ * @param serverValue - The controlled value from the server (undefined means uncontrolled)
52
+ * @param defaultValue - The default value for uncontrolled mode
53
+ * @param onChange - Optional callback when value changes (dispatches to server)
54
+ * @returns Tuple of [currentValue, setValue, isPending] - isPending is true while waiting for server response
55
+ */
56
+ export declare function useOptimisticState<T>(serverValue: T | undefined, defaultValue: T, onChange?: (value: T) => void): [T, (value: T) => void, boolean];
57
+ /**
58
+ * Hook for optimistic UI state updates with array values.
59
+ * Provides immediate visual feedback when users interact with controlled components,
60
+ * while the server state remains the source of truth.
61
+ *
62
+ * @param serverValue - The controlled array value from the server (undefined means uncontrolled)
63
+ * @param defaultValue - The default array value for uncontrolled mode
64
+ * @param onChange - Optional callback when value changes (dispatches to server)
65
+ * @returns Tuple of [currentValue, setValue, isPending] - isPending is true while waiting for server response
66
+ */
67
+ export declare function useOptimisticArrayState<T>(serverValue: T[] | undefined, defaultValue: T[], onChange?: (value: T[]) => void): [T[], (value: T[]) => void, boolean];
@@ -0,0 +1,5 @@
1
+ import { IkonUiComponentResolver, IkonUiModuleLoader, IkonUiRegistry } from '../../sdk-react-ui/src/index.ts';
2
+ export declare const IKON_UI_RADIX_MODULE = "radix";
3
+ export declare const loadRadixModule: IkonUiModuleLoader;
4
+ export declare function registerRadixModule(registry: IkonUiRegistry): void;
5
+ export declare function createRadixResolvers(): IkonUiComponentResolver[];
@@ -0,0 +1,61 @@
1
+ import { UiRenderContext } from '../../../sdk-react-ui/src/index.ts';
2
+ export interface FileInfo {
3
+ file: File;
4
+ uploadId: string;
5
+ }
6
+ export interface FileSelectedPayload {
7
+ Files: Array<{
8
+ FileName: string;
9
+ Size: number;
10
+ Mime: string;
11
+ }>;
12
+ }
13
+ export interface FileUploadStartedPayload {
14
+ UploadId: string;
15
+ FileName: string;
16
+ Size: number;
17
+ Mime: string;
18
+ }
19
+ export interface FileUploadProgressPayload {
20
+ UploadId: string;
21
+ FileName: string;
22
+ ProgressPercentage: number;
23
+ }
24
+ export interface FileUploadCompletePayload {
25
+ UploadId: string;
26
+ FileName: string;
27
+ Size: number;
28
+ Mime: string;
29
+ FilePath: string;
30
+ }
31
+ export interface FileUploadErrorPayload {
32
+ UploadId: string;
33
+ FileName: string;
34
+ ErrorMessage: string;
35
+ }
36
+ export interface UploadCallbacks {
37
+ onFileSelectedId?: string;
38
+ onUploadStartedId?: string;
39
+ onUploadProgressId?: string;
40
+ onUploadCompleteId?: string;
41
+ onUploadErrorId?: string;
42
+ }
43
+ export interface UploadOptions {
44
+ callbacks: UploadCallbacks;
45
+ context: UiRenderContext;
46
+ uploadPath?: string;
47
+ }
48
+ export declare function generateUploadId(): string;
49
+ export declare function validateFile(file: File, accept?: string[], maxSize?: number): {
50
+ valid: boolean;
51
+ error?: string;
52
+ };
53
+ export declare function uploadFileViaProtocol(fileInfo: FileInfo, options: UploadOptions): Promise<void>;
54
+ export declare function processAndUploadFiles(files: File[], options: {
55
+ multiple: boolean;
56
+ accept?: string[];
57
+ maxFileSize?: number;
58
+ callbacks: UploadCallbacks;
59
+ context: UiRenderContext;
60
+ uploadPath?: string;
61
+ }): Promise<void>;