aplance-ui 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +29 -0
  3. package/dist/api.d.ts +175 -0
  4. package/dist/api.js +1954 -0
  5. package/dist/api.js.map +1 -0
  6. package/dist/frameworks/astro/astro.config.snippet.md +23 -0
  7. package/dist/frameworks/astro/postcss.config.mjs.template +20 -0
  8. package/dist/frameworks/astro/vite-inline.snippet.md +22 -0
  9. package/dist/frameworks/electron-vite/vite.config.snippet.md +44 -0
  10. package/dist/frameworks/next/layout-import.snippet.md +19 -0
  11. package/dist/frameworks/next/next.config.snippet.md +15 -0
  12. package/dist/frameworks/next/postcss.config.js.template +16 -0
  13. package/dist/frameworks/tanstack-start/postcss.config.ts.template +17 -0
  14. package/dist/frameworks/tanstack-start/vite-inline.snippet.md +22 -0
  15. package/dist/frameworks/vite-react/postcss.config.ts.template +16 -0
  16. package/dist/frameworks/vite-react/vite-inline.snippet.md +20 -0
  17. package/dist/frameworks/vite-react/vite.config.ts.template +48 -0
  18. package/dist/index.js +2047 -0
  19. package/dist/index.js.map +1 -0
  20. package/package.json +63 -0
  21. package/registry/components/primitives/icon/icon.module.css +63 -0
  22. package/registry/components/primitives/icon/icon.tsx +53 -0
  23. package/registry/components/primitives/modal/modal-context.ts +19 -0
  24. package/registry/components/primitives/modal/modal.module.css +415 -0
  25. package/registry/components/primitives/modal/modal.tsx +550 -0
  26. package/registry/components/primitives/popover/popover-context.ts +28 -0
  27. package/registry/components/primitives/popover/popover.module.css +28 -0
  28. package/registry/components/primitives/popover/popover.tsx +465 -0
  29. package/registry/components/ui/accordion/accordion.module.css +208 -0
  30. package/registry/components/ui/accordion/accordion.tsx +327 -0
  31. package/registry/components/ui/avatar/avatar.module.css +32 -0
  32. package/registry/components/ui/avatar/avatar.tsx +37 -0
  33. package/registry/components/ui/badge/badge.module.css +103 -0
  34. package/registry/components/ui/badge/badge.tsx +29 -0
  35. package/registry/components/ui/button/button.module.css +216 -0
  36. package/registry/components/ui/button/button.tsx +133 -0
  37. package/registry/components/ui/chart/chart.module.css +168 -0
  38. package/registry/components/ui/chart/chart.tsx +1293 -0
  39. package/registry/components/ui/chart/types.ts +210 -0
  40. package/registry/components/ui/chart/utils.ts +59 -0
  41. package/registry/components/ui/copy-button/copy-button.module.css +21 -0
  42. package/registry/components/ui/copy-button/copy-button.tsx +123 -0
  43. package/registry/components/ui/countdown/countdown.module.css +5 -0
  44. package/registry/components/ui/countdown/countdown.tsx +152 -0
  45. package/registry/components/ui/data-table/checkbox-column.tsx +59 -0
  46. package/registry/components/ui/data-table/data-table.module.css +594 -0
  47. package/registry/components/ui/data-table/data-table.tsx +1109 -0
  48. package/registry/components/ui/data-table/filter-bar.tsx +33 -0
  49. package/registry/components/ui/data-table/pagination-bar.tsx +125 -0
  50. package/registry/components/ui/data-table/types.ts +594 -0
  51. package/registry/components/ui/data-table/useDataTable.tsx +573 -0
  52. package/registry/components/ui/data-table/utils.ts +445 -0
  53. package/registry/components/ui/empty-state/empty-state.module.css +26 -0
  54. package/registry/components/ui/empty-state/empty-state.tsx +32 -0
  55. package/registry/components/ui/input-fields/color-picker/color-palette.module.css +102 -0
  56. package/registry/components/ui/input-fields/color-picker/color-palette.tsx +92 -0
  57. package/registry/components/ui/input-fields/color-picker/color-picker.module.css +29 -0
  58. package/registry/components/ui/input-fields/color-picker/color-picker.tsx +168 -0
  59. package/registry/components/ui/input-fields/common/field-message/field-message.module.css +28 -0
  60. package/registry/components/ui/input-fields/common/field-message/field-message.tsx +39 -0
  61. package/registry/components/ui/input-fields/common/input-field-common.module.css +318 -0
  62. package/registry/components/ui/input-fields/common/input-field-native.module.css +267 -0
  63. package/registry/components/ui/input-fields/common/picker-popover-common.module.css +40 -0
  64. package/registry/components/ui/input-fields/common/select-button/select-button.module.css +9 -0
  65. package/registry/components/ui/input-fields/common/select-button/select-button.tsx +171 -0
  66. package/registry/components/ui/input-fields/common/types.ts +38 -0
  67. package/registry/components/ui/input-fields/custom-select/custom-select.module.css +56 -0
  68. package/registry/components/ui/input-fields/custom-select/custom-select.tsx +403 -0
  69. package/registry/components/ui/input-fields/date-picker/calendar.module.css +311 -0
  70. package/registry/components/ui/input-fields/date-picker/calendar.tsx +186 -0
  71. package/registry/components/ui/input-fields/date-picker/date-picker.module.css +57 -0
  72. package/registry/components/ui/input-fields/date-picker/date-picker.tsx +945 -0
  73. package/registry/components/ui/input-fields/date-picker/types.ts +102 -0
  74. package/registry/components/ui/input-fields/date-picker/utils.ts +236 -0
  75. package/registry/components/ui/input-fields/emoji-picker/emoji-palette.module.css +90 -0
  76. package/registry/components/ui/input-fields/emoji-picker/emoji-palette.tsx +168 -0
  77. package/registry/components/ui/input-fields/emoji-picker/emoji-picker.module.css +8 -0
  78. package/registry/components/ui/input-fields/emoji-picker/emoji-picker.tsx +102 -0
  79. package/registry/components/ui/input-fields/emoji-picker/utils.ts +505 -0
  80. package/registry/components/ui/input-fields/field-group/field-group.module.css +86 -0
  81. package/registry/components/ui/input-fields/field-group/field-group.tsx +86 -0
  82. package/registry/components/ui/input-fields/input/input.tsx +319 -0
  83. package/registry/components/ui/input-fields/media-input/kind-icons.tsx +62 -0
  84. package/registry/components/ui/input-fields/media-input/media-input.module.css +294 -0
  85. package/registry/components/ui/input-fields/media-input/media-input.tsx +327 -0
  86. package/registry/components/ui/input-fields/media-input/media-preview.tsx +101 -0
  87. package/registry/components/ui/input-fields/media-input/types.ts +129 -0
  88. package/registry/components/ui/input-fields/media-input/useMediaUpload.tsx +302 -0
  89. package/registry/components/ui/input-fields/media-input/utils.ts +325 -0
  90. package/registry/components/ui/input-fields/otp-input/otp-input.module.css +24 -0
  91. package/registry/components/ui/input-fields/otp-input/otp-input.tsx +291 -0
  92. package/registry/components/ui/input-fields/select/select.tsx +118 -0
  93. package/registry/components/ui/input-fields/switch/switch.module.css +70 -0
  94. package/registry/components/ui/input-fields/switch/switch.tsx +59 -0
  95. package/registry/components/ui/input-fields/textarea/textarea.tsx +133 -0
  96. package/registry/components/ui/input-fields/time-picker/time-picker.module.css +57 -0
  97. package/registry/components/ui/input-fields/time-picker/time-picker.tsx +437 -0
  98. package/registry/components/ui/loader/loader.module.css +156 -0
  99. package/registry/components/ui/loader/loader.tsx +102 -0
  100. package/registry/components/ui/stepper/stepper.module.css +294 -0
  101. package/registry/components/ui/stepper/stepper.tsx +197 -0
  102. package/registry/components/ui/tabs/tabs.module.css +150 -0
  103. package/registry/components/ui/tabs/tabs.tsx +134 -0
  104. package/registry/components/ui/toast/toast.module.css +159 -0
  105. package/registry/components/ui/toast/toast.tsx +104 -0
  106. package/registry/components/ui/tooltip/tooltip.module.css +82 -0
  107. package/registry/components/ui/tooltip/tooltip.tsx +72 -0
  108. package/registry/global.d.ts +4 -0
  109. package/registry/hooks/useFocusOutside.tsx +33 -0
  110. package/registry/hooks/useResizeObserver.tsx +32 -0
  111. package/registry/lib/dom.ts +25 -0
  112. package/registry/lib/string.ts +23 -0
  113. package/registry/registry.json +719 -0
  114. package/registry/styles/app.css +240 -0
  115. package/registry/styles/components.css +78 -0
  116. package/registry/styles/fonts/geist-regular.woff2 +0 -0
  117. package/registry/styles/globals.css +7 -0
  118. package/registry/styles/media.css +25 -0
  119. package/registry/styles/utilities.css +90 -0
  120. package/registry/themes/colors/blue.css +37 -0
  121. package/registry/themes/colors/green.css +37 -0
  122. package/registry/themes/colors/rose.css +37 -0
  123. package/registry/themes/colors/slate.css +37 -0
  124. package/registry/themes/colors/stone.css +37 -0
  125. package/registry/themes/colors/violet.css +37 -0
  126. package/registry/themes/colors/zinc.css +37 -0
  127. package/registry/themes/radius/pill.css +8 -0
  128. package/registry/themes/radius/rounded.css +8 -0
  129. package/registry/themes/radius/sharp.css +8 -0
  130. package/registry/themes/spacing/compact.css +17 -0
  131. package/registry/themes/spacing/spacious.css +17 -0
  132. package/registry/tsconfig.json +25 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aplance Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # aplance-ui
2
+
3
+ A source-first React UI CLI by Aplance Technologies. `aplance-ui` scaffolds components, hooks, and tokenized styles directly into your project, so your team owns and edits the generated source as normal app code.
4
+
5
+ ## Install & init
6
+
7
+ Inside an existing React project (Vite + React, Next.js, TanStack Start, Astro, or Electron-Vite):
8
+
9
+ ```bash
10
+ npx aplance-ui init
11
+ ```
12
+
13
+ The CLI auto-detects your framework, prompts for color/radius/spacing themes and components, then writes everything into your source tree.
14
+
15
+ ## Commands
16
+
17
+ - `npx aplance-ui init` - scaffold config, styles, and selected components.
18
+ - `npx aplance-ui add <names...>` - add more components later (transitive deps resolved automatically).
19
+ - `npx aplance-ui list` - browse available components and themes.
20
+
21
+ Common flags: `--all`, `--with-utilities`, `--src-dir`, `--alias`, `--package-manager`, `--dry-run`, `--force`, `--yes`.
22
+
23
+ ## Documentation
24
+
25
+ Full guides, API reference, theming, and component examples live at **[ui.aplance.com](https://ui.aplance.com)**.
26
+
27
+ ## License
28
+
29
+ MIT (c) Aplance Technologies. See [LICENSE](./LICENSE).
package/dist/api.d.ts ADDED
@@ -0,0 +1,175 @@
1
+ declare const SUPPORTED_TEMPLATES: readonly ["vite-react", "next", "tanstack-start", "astro", "electron-vite"];
2
+ type FrameworkTemplate = (typeof SUPPORTED_TEMPLATES)[number];
3
+ declare const CSS_CONFIG_PLACEMENTS: readonly ["auto", "inline", "file"];
4
+ type CssConfigPlacement = (typeof CSS_CONFIG_PLACEMENTS)[number];
5
+ interface ComponentsConfig {
6
+ $schema: string;
7
+ template: FrameworkTemplate;
8
+ /** Posix-style, relative to cwd. "src" by default; "src/renderer/src" for Electron-Vite. */
9
+ srcDir: string;
10
+ /** Path-alias prefix without trailing /* (e.g. "@" → "@/*") */
11
+ alias: string;
12
+ /**
13
+ * Active theme - three independent dimensions.
14
+ * `color` selects the palette (slate, zinc, rose, …).
15
+ * `radius` selects the corner-radius scale (sharp, rounded, pill, …).
16
+ * `spacing` selects the gutter scale (compact, spacious, …).
17
+ * `default` on any axis means "no override".
18
+ */
19
+ theme: {
20
+ color: string;
21
+ radius: string;
22
+ spacing: string;
23
+ };
24
+ /** Subpaths under srcDir - tweakable but sensible defaults cover 95% of projects */
25
+ paths: {
26
+ styles: string;
27
+ components: string;
28
+ hooks: string;
29
+ lib: string;
30
+ };
31
+ cssModules: {
32
+ /** Human-readable CSS-Modules class names. Vite-only; ignored elsewhere. */
33
+ pretty: boolean;
34
+ };
35
+ utilities: {
36
+ /** Enable postcss-token-utilities in the generated CSS config */
37
+ enabled: boolean;
38
+ };
39
+ cssConfig: {
40
+ placement: CssConfigPlacement;
41
+ };
42
+ }
43
+ interface ResolvedPaths {
44
+ srcDir: string;
45
+ stylesDir: string;
46
+ componentsDir: string;
47
+ hooksDir: string;
48
+ libDir: string;
49
+ }
50
+ interface MakeDefaultOptions {
51
+ template: FrameworkTemplate;
52
+ srcDir?: string;
53
+ alias?: string;
54
+ color?: string;
55
+ radius?: string;
56
+ spacing?: string;
57
+ pretty?: boolean;
58
+ utilities?: boolean;
59
+ cssConfigPlacement?: CssConfigPlacement;
60
+ }
61
+ declare const makeDefaultConfig: (opts: MakeDefaultOptions) => ComponentsConfig;
62
+ declare const configExists: (cwd: string) => boolean;
63
+ declare const loadConfig: (cwd: string) => ComponentsConfig;
64
+ declare const resolvePaths: (cwd: string, cfg: ComponentsConfig) => ResolvedPaths;
65
+
66
+ type UnitKind = "component" | "hook" | "lib";
67
+ type UnitGroup = "ui" | "primitives" | null;
68
+ interface RegistryUnit {
69
+ name: string;
70
+ kind: UnitKind;
71
+ group: UnitGroup;
72
+ files: string[];
73
+ deps: string[];
74
+ /**
75
+ * External npm packages (root specifiers, e.g. `react`, `@tanstack/react-table`)
76
+ * this unit's source imports. The CLI uses `installMeta.packageVersions` to
77
+ * resolve version ranges for each entry.
78
+ */
79
+ externalDeps: string[];
80
+ }
81
+ interface InstallMeta {
82
+ baseDependencies: Record<string, string>;
83
+ baseDevDependencies: Record<string, string>;
84
+ utilitiesDevDependencies: Record<string, string>;
85
+ packageVersions: Record<string, string>;
86
+ }
87
+ interface ThemeDescriptor {
88
+ id: string;
89
+ label: string;
90
+ description: string;
91
+ /** posix-style, relative to registry root. Empty string for the "default" variant. */
92
+ file: string;
93
+ }
94
+ interface ThemeRegistry {
95
+ colors: ThemeDescriptor[];
96
+ radii: ThemeDescriptor[];
97
+ spacing: ThemeDescriptor[];
98
+ }
99
+ interface Registry {
100
+ version: number;
101
+ generated: string;
102
+ units: RegistryUnit[];
103
+ themes?: ThemeRegistry;
104
+ installMeta?: InstallMeta;
105
+ }
106
+ interface LoadedRegistry extends Registry {
107
+ /** Absolute path to the bundled registry root (contains registry.json + sources). */
108
+ root: string;
109
+ themes: ThemeRegistry;
110
+ installMeta: InstallMeta;
111
+ }
112
+ declare const loadRegistry: () => LoadedRegistry;
113
+ declare const resolveUnits: (registry: Registry, names: string[]) => RegistryUnit[];
114
+ declare const allUnitsInOrder: (registry: Registry) => RegistryUnit[];
115
+ declare const findColor: (registry: LoadedRegistry, id: string) => ThemeDescriptor;
116
+ declare const findRadius: (registry: LoadedRegistry, id: string) => ThemeDescriptor;
117
+ declare const findSpacing: (registry: LoadedRegistry, id: string) => ThemeDescriptor;
118
+
119
+ declare const PACKAGE_MANAGERS: readonly ["npm", "pnpm", "yarn", "bun"];
120
+ type PackageManager = (typeof PACKAGE_MANAGERS)[number];
121
+
122
+ interface InitCommandOptions {
123
+ cwd: string;
124
+ template?: FrameworkTemplate;
125
+ srcDir?: string;
126
+ alias?: string;
127
+ color?: string;
128
+ radius?: string;
129
+ spacing?: string;
130
+ yes?: boolean;
131
+ force?: boolean;
132
+ dryRun?: boolean;
133
+ skipStyles?: boolean;
134
+ skipCssConfig?: boolean;
135
+ withUtilities?: boolean;
136
+ cssConfigPlacement?: CssConfigPlacement;
137
+ prettyCssModules?: boolean;
138
+ /** Rewrite components.json even if it already exists */
139
+ overwriteConfig?: boolean;
140
+ /** Pre-selected component names to copy during init. If omitted and yes=false, an interactive multi-select runs. */
141
+ components?: string[];
142
+ /** Copy every unit in the registry (library mode). Overrides `components` when true. */
143
+ all?: boolean;
144
+ /**
145
+ * Auto-install runtime + dev dependencies after scaffolding. `true` by default.
146
+ * When unset and `yes` is false, the CLI prompts for confirmation.
147
+ * Force-disable with `install: false` (programmatic use) or `--no-install`.
148
+ */
149
+ install?: boolean;
150
+ /** Force a specific package manager instead of auto-detecting from lockfiles. */
151
+ packageManager?: PackageManager;
152
+ }
153
+ declare const runInit: (opts: InitCommandOptions) => Promise<void>;
154
+
155
+ interface AddCommandOptions {
156
+ cwd: string;
157
+ names: string[];
158
+ yes?: boolean;
159
+ force?: boolean;
160
+ dryRun?: boolean;
161
+ all?: boolean;
162
+ /** Auto-install runtime dependencies for the added units. Defaults to true. */
163
+ install?: boolean;
164
+ /** Force a specific package manager instead of auto-detecting. */
165
+ packageManager?: PackageManager;
166
+ }
167
+ declare const runAdd: (opts: AddCommandOptions) => Promise<void>;
168
+
169
+ interface ListCommandOptions {
170
+ cwd: string;
171
+ json?: boolean;
172
+ }
173
+ declare const runList: (opts: ListCommandOptions) => void;
174
+
175
+ export { type AddCommandOptions, CSS_CONFIG_PLACEMENTS, type ComponentsConfig, type CssConfigPlacement, type FrameworkTemplate, type InitCommandOptions, type InstallMeta, type ListCommandOptions, type LoadedRegistry, type Registry, type RegistryUnit, type ResolvedPaths, SUPPORTED_TEMPLATES, type ThemeDescriptor, type ThemeRegistry, allUnitsInOrder, configExists, findColor, findRadius, findSpacing, loadConfig, loadRegistry, makeDefaultConfig, resolvePaths, resolveUnits, runAdd, runInit, runList };