cekat-ui 1.2.9 → 1.3.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 (113) hide show
  1. package/README.md +125 -44
  2. package/dist/index.d.mts +876 -0
  3. package/dist/index.d.ts +876 -23
  4. package/dist/index.mjs +14285 -0
  5. package/dist/index.umd.js +8 -3
  6. package/dist/style.css +898 -691
  7. package/package.json +35 -6
  8. package/tailwind.preset.cjs +452 -453
  9. package/dist/components/Alert/Alert.d.ts +0 -6
  10. package/dist/components/Alert/alert.styles.d.ts +0 -47
  11. package/dist/components/Alert/alert.types.d.ts +0 -46
  12. package/dist/components/Alert/index.d.ts +0 -3
  13. package/dist/components/Avatar/Avatar.d.ts +0 -6
  14. package/dist/components/Avatar/AvatarIcons.d.ts +0 -8
  15. package/dist/components/Avatar/avatar.styles.d.ts +0 -12
  16. package/dist/components/Avatar/avatar.types.d.ts +0 -16
  17. package/dist/components/Avatar/index.d.ts +0 -3
  18. package/dist/components/AvatarGroup/AvatarGroup.d.ts +0 -6
  19. package/dist/components/AvatarGroup/avatargroup.styles.d.ts +0 -17
  20. package/dist/components/AvatarGroup/avatargroup.types.d.ts +0 -18
  21. package/dist/components/AvatarGroup/index.d.ts +0 -3
  22. package/dist/components/AvatarLabelGroup/AvatarLabelGroup.d.ts +0 -6
  23. package/dist/components/AvatarLabelGroup/avatarlabelgroup.styles.d.ts +0 -5
  24. package/dist/components/AvatarLabelGroup/avatarlabelgroup.types.d.ts +0 -14
  25. package/dist/components/AvatarLabelGroup/index.d.ts +0 -3
  26. package/dist/components/AvatarProfilePhoto/AvatarProfilePhoto.d.ts +0 -6
  27. package/dist/components/AvatarProfilePhoto/avatarprofilephoto.styles.d.ts +0 -10
  28. package/dist/components/AvatarProfilePhoto/avatarprofilephoto.types.d.ts +0 -12
  29. package/dist/components/AvatarProfilePhoto/index.d.ts +0 -3
  30. package/dist/components/Badge/Badge.d.ts +0 -6
  31. package/dist/components/Badge/badge.styles.d.ts +0 -20
  32. package/dist/components/Badge/badge.types.d.ts +0 -23
  33. package/dist/components/Badge/index.d.ts +0 -3
  34. package/dist/components/BadgeGroup/BadgeGroup.d.ts +0 -6
  35. package/dist/components/BadgeGroup/badgegroup.styles.d.ts +0 -28
  36. package/dist/components/BadgeGroup/badgegroup.types.d.ts +0 -19
  37. package/dist/components/BadgeGroup/index.d.ts +0 -3
  38. package/dist/components/Button/Button.d.ts +0 -9
  39. package/dist/components/Button/ButtonIcon.d.ts +0 -2
  40. package/dist/components/Button/ButtonText.d.ts +0 -2
  41. package/dist/components/Button/button.styles.d.ts +0 -6
  42. package/dist/components/Button/button.types.d.ts +0 -18
  43. package/dist/components/Button/index.d.ts +0 -3
  44. package/dist/components/Checkbox/Checkbox.d.ts +0 -4
  45. package/dist/components/Checkbox/checkbox.styles.d.ts +0 -5
  46. package/dist/components/Checkbox/checkbox.types.d.ts +0 -12
  47. package/dist/components/Checkbox/index.d.ts +0 -3
  48. package/dist/components/Dropdown/Dropdown.d.ts +0 -2
  49. package/dist/components/Dropdown/dropdown.styles.d.ts +0 -19
  50. package/dist/components/Dropdown/dropdown.types.d.ts +0 -44
  51. package/dist/components/Dropdown/index.d.ts +0 -3
  52. package/dist/components/Input/CardNumberInput.d.ts +0 -19
  53. package/dist/components/Input/Input.d.ts +0 -8
  54. package/dist/components/Input/InputCounter.d.ts +0 -18
  55. package/dist/components/Input/InputPrefix.d.ts +0 -4
  56. package/dist/components/Input/InputSuffix.d.ts +0 -4
  57. package/dist/components/Input/PhoneInput.d.ts +0 -18
  58. package/dist/components/Input/SaleAmountInput.d.ts +0 -20
  59. package/dist/components/Input/index.d.ts +0 -13
  60. package/dist/components/Input/input.styles.d.ts +0 -36
  61. package/dist/components/Input/input.types.d.ts +0 -39
  62. package/dist/components/InputDropdown/InputDropdown.d.ts +0 -2
  63. package/dist/components/InputDropdown/index.d.ts +0 -3
  64. package/dist/components/InputDropdown/inputDropdown.styles.d.ts +0 -15
  65. package/dist/components/InputDropdown/inputDropdown.types.d.ts +0 -45
  66. package/dist/components/Loading/Loading.d.ts +0 -6
  67. package/dist/components/Loading/LoadingSpinner.d.ts +0 -9
  68. package/dist/components/Loading/index.d.ts +0 -3
  69. package/dist/components/Loading/loading.styles.d.ts +0 -6
  70. package/dist/components/Loading/loading.types.d.ts +0 -10
  71. package/dist/components/MultiSelectInput/MultiSelectInput.d.ts +0 -24
  72. package/dist/components/MultiSelectInput/index.d.ts +0 -1
  73. package/dist/components/MultiSelectInput/multiSelectInput.styles.d.ts +0 -17
  74. package/dist/components/Radio/RadioGroup.d.ts +0 -6
  75. package/dist/components/Radio/RadioGroupItem.d.ts +0 -3
  76. package/dist/components/Radio/index.d.ts +0 -3
  77. package/dist/components/Radio/radio.styles.d.ts +0 -9
  78. package/dist/components/Radio/radio.types.d.ts +0 -17
  79. package/dist/components/Tab/Tab.d.ts +0 -13
  80. package/dist/components/Tab/TabList.d.ts +0 -14
  81. package/dist/components/Tab/index.d.ts +0 -4
  82. package/dist/components/Tab/tab.styles.d.ts +0 -15
  83. package/dist/components/Tab/tab.types.d.ts +0 -46
  84. package/dist/components/TabBrowser/TabBrowser.d.ts +0 -4
  85. package/dist/components/TabBrowser/TabBrowserBar.d.ts +0 -17
  86. package/dist/components/TabBrowser/index.d.ts +0 -4
  87. package/dist/components/TabBrowser/tabbrowser.styles.d.ts +0 -53
  88. package/dist/components/TabBrowser/tabbrowser.types.d.ts +0 -44
  89. package/dist/components/Tag/Tag.d.ts +0 -6
  90. package/dist/components/Tag/index.d.ts +0 -3
  91. package/dist/components/Tag/tag.styles.d.ts +0 -19
  92. package/dist/components/Tag/tag.types.d.ts +0 -21
  93. package/dist/components/Textarea/Textarea.d.ts +0 -4
  94. package/dist/components/Textarea/index.d.ts +0 -3
  95. package/dist/components/Textarea/textarea.styles.d.ts +0 -14
  96. package/dist/components/Textarea/textarea.types.d.ts +0 -17
  97. package/dist/components/Toggle/Toggle.d.ts +0 -4
  98. package/dist/components/Toggle/index.d.ts +0 -3
  99. package/dist/components/Toggle/toggle.styles.d.ts +0 -10
  100. package/dist/components/Toggle/toggle.types.d.ts +0 -11
  101. package/dist/components/Tooltip/Tooltip.d.ts +0 -6
  102. package/dist/components/Tooltip/index.d.ts +0 -2
  103. package/dist/components/Tooltip/tooltip.styles.d.ts +0 -8
  104. package/dist/components/Tooltip/tooltip.types.d.ts +0 -13
  105. package/dist/components/WebsiteCopyInput/WebsiteCopyInput.d.ts +0 -19
  106. package/dist/components/WebsiteCopyInput/index.d.ts +0 -1
  107. package/dist/components/WebsiteCopyInput/websiteCopyInput.styles.d.ts +0 -25
  108. package/dist/components/WebsiteInput/WebsiteInput.d.ts +0 -18
  109. package/dist/components/WebsiteInput/index.d.ts +0 -1
  110. package/dist/components/WebsiteInput/websiteInput.styles.d.ts +0 -24
  111. package/dist/index.es.js +0 -10997
  112. package/dist/utils/cn.d.ts +0 -2
  113. package/dist/utils/color.d.ts +0 -4
package/README.md CHANGED
@@ -3,105 +3,186 @@
3
3
  A modern, lightweight **React UI component library** built with **TypeScript**, **Tailwind CSS**, and **Storybook**.
4
4
 
5
5
  `cekat-ui` is designed to be:
6
- - ✅ Composable (shadcn / Radix-inspired)
7
- - Tree-shakeable
8
- - Fully typed
9
- - Framework-agnostic (works with Next.js, Vite, CRA, etc.)
6
+
7
+ - Composable (compound components, Radix / react-aria-inspired)
8
+ - Tree-shakeable (ESM + UMD, fully typed)
9
+ - Framework-friendly (Next.js, Vite, and other React 18 apps)
10
+
11
+ This repo uses **Yarn Classic** (`yarn.lock` v1).
10
12
 
11
13
  ---
12
14
 
13
- ## Features
15
+ ## Features
16
+
17
+ Public exports from `cekat-ui`:
18
+
19
+ | Area | Components |
20
+ | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | Actions & feedback | `Button`, `Toggle`, `Checkbox`, `RadioGroup` / `RadioGroupItem`, `Tooltip`, `Alert`, `Loading`, `Dropdown` |
22
+ | Display | `Avatar`, `AvatarGroup`, `AvatarLabelGroup`, `AvatarProfilePhoto`, `Badge`, `BadgeGroup`, `Tag` |
23
+ | Navigation | `Tab` / `TabList`, `TabBrowser` / `TabBrowserBar` |
24
+ | Inputs | `Input` (compound `Input.Prefix` / `Input.Suffix`), `PhoneInput`, `CardNumberInput`, `SaleAmountInput`, `InputCounter`, `Textarea`, `MultiSelectInput`, `InputDropdown`, `WebsiteInput`, `WebsiteCopyInput` |
14
25
 
15
- - Button (compound component)
16
- - Checkbox
17
- - Radio Group
18
- - Toggle (Switch)
19
- - Tooltip
20
- - Tailwind CSS styling
26
+ Icons used in stories and examples come from [`@tabler/icons-react`](https://tabler.io/icons).
21
27
 
22
28
  ---
23
29
 
24
- ## 📦 Installation
30
+ ## Installation
25
31
 
26
32
  ```bash
27
33
  npm install cekat-ui
34
+ # or
35
+ yarn add cekat-ui
36
+ ```
28
37
 
29
- or
38
+ Peer dependencies:
30
39
 
31
- yarn add cekat-ui
40
+ ```json
41
+ {
42
+ "react": "^18.3.1",
43
+ "react-dom": "^18.3.1"
44
+ }
32
45
  ```
33
46
 
47
+ ---
48
+
34
49
  ## Styles
35
50
 
36
- `cekat-ui` ships with prebuilt styles. Import once in your app entry file.
51
+ `cekat-ui` ships prebuilt CSS. Import it once in the app entry file. The file includes component styles and base typography (Nunito); it does not fetch remote fonts.
37
52
 
38
- Next.js (App Router):
39
- ```ts
53
+ Next.js App Router (`app/layout.tsx`):
54
+
55
+ ```tsx
40
56
  import 'cekat-ui/style.css';
57
+ ```
41
58
 
59
+ Next.js Pages Router (`pages/_app.tsx`):
42
60
 
61
+ ```tsx
62
+ import 'cekat-ui/style.css';
63
+ ```
64
+
65
+ ### Tailwind preset
66
+
67
+ To use design tokens (`primary`, `bg-primary-50`, loading keyframes, and so on) in your own Tailwind classes, add the published preset:
68
+
69
+ ```js
70
+ // tailwind.config.js / tailwind.config.cjs
71
+ module.exports = {
72
+ presets: [require('cekat-ui/tailwind-preset')],
73
+ content: ['./app/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
74
+ };
75
+ ```
76
+
77
+ `style.css` is enough for component appearance. The preset is for token classes in the consuming app. A working Next 14 example lives in `fixtures/next-consumer`.
78
+
79
+ ---
43
80
 
44
81
  ## Usage
45
82
 
46
83
  ### Button
84
+
85
+ `Button` is built on [React Aria Components `Button`](https://react-aria.adobe.com/Button). Use `onPress` for mouse, touch, and keyboard. `isPending` keeps the control focusable, blocks further presses, and announces progress. `onClick` and `disabled` still work as aliases for `onPress` and `isDisabled`.
86
+
47
87
  ```tsx
48
88
  import { Button } from 'cekat-ui';
49
89
 
50
90
  export default function Example() {
51
91
  return (
52
- <Button size="md" tone="primary" variant="solid">
53
- Click me
92
+ <Button size="md" tone="primary" variant="solid" onPress={() => save()}>
93
+ Save
54
94
  </Button>
55
95
  );
56
96
  }
57
97
  ```
58
98
 
59
99
  ### Compound usage
100
+
60
101
  ```tsx
102
+ import { IconChevronLeft } from '@tabler/icons-react';
103
+ import { Button } from 'cekat-ui';
104
+
61
105
  <Button>
62
106
  <Button.Icon>
63
- <IconChevronLeft size={16} />
107
+ <IconChevronLeft />
64
108
  </Button.Icon>
65
109
  <Button.Text>Submit</Button.Text>
66
- </Button>
110
+ </Button>;
111
+ ```
112
+
113
+ `Button.Icon` sizes the glyph from `size` (xs 18 · sm/md 20 · lg 24 · xl/2xl 28). Omit `size` on the icon.
114
+
115
+ `Button` sizes: `xs` | `sm` | `md` | `lg` | `xl` | `2xl`. Tone: `primary` | `destructive`. Variants include `solid`, `outline`, `ghost`, and `plain` / `plain-black` (link-style: hug content, 4px gap, no padding or radius).
116
+
117
+ ### Input
118
+
119
+ ```tsx
120
+ import { Input } from 'cekat-ui';
121
+
122
+ <Input placeholder="Search" />;
67
123
  ```
68
124
 
125
+ ---
126
+
69
127
  ## Components API
70
128
 
71
- All components support:
72
- - `className` override
73
- - Controlled & uncontrolled usage
74
- - Keyboard & screen reader accessibility
75
- - Size variants (`sm`, `md`, `lg`)
129
+ Most components accept `className` overrides. Sizes, variants, and controlled vs uncontrolled usage differ per component — they are not a single shared API.
76
130
 
77
- For full props reference, see Storybook.
131
+ For full props, variants, and interaction examples, use Storybook.
132
+
133
+ ---
78
134
 
79
135
  ## Storybook
80
136
 
81
- Run Storybook locally:
82
137
  ```bash
83
- yarn dev
138
+ yarn dev # http://localhost:6006
139
+ yarn build:storybook # static build → storybook-static/
84
140
  ```
85
141
 
86
- Build static Storybook:
142
+ ---
143
+
144
+ ## Testing
145
+
146
+ Stories are component tests via [Storybook's Vitest addon](https://storybook.js.org/docs/writing-tests/integrations/vitest-addon). They run in Playwright Chromium (browser mode).
147
+
87
148
  ```bash
88
- yarn build:storybook
149
+ # Watch (starts Storybook for failure links when it is not already running)
150
+ yarn test-storybook
151
+
152
+ # Single run (CI)
153
+ yarn test-storybook --run
89
154
  ```
90
155
 
91
- ## Peer Dependencies
156
+ Install browser binaries once with `yarn playwright install chromium`. In Storybook, use the testing widget to run or watch the same tests.
92
157
 
93
- ```json
94
- {
95
- "react": ">=18",
96
- "react-dom": ">=18"
97
- }
158
+ Smoke tests cover every story; interaction tests run any story `play` function. Button contracts live in `stories/Button.behaviors.stories.tsx` (press, disabled, pending chrome, icon sizes, slots, ref).
159
+
160
+ ---
161
+
162
+ ## Local development
163
+
164
+ Node **22** (matches CI). After `yarn install`:
165
+
166
+ ```bash
167
+ yarn typecheck
168
+ yarn lint
169
+ yarn fmt:check
170
+ yarn test-storybook --run
171
+ yarn build:lib # ESM/UMD + dist/style.css
172
+ yarn check:pack # dist artifacts, publint, attw
173
+ yarn check:consumer # Next 14 smoke against the packed tarball
98
174
  ```
99
175
 
100
- ## Tech Stack
176
+ `yarn fmt` / `yarn lint:fix` apply formatting and lint fixes. Pre-commit runs `lint-staged` (oxfmt).
177
+
178
+ ---
179
+
180
+ ## Tech stack
101
181
 
102
- - React
103
- - TypeScript
104
- - Tailwind CSS
105
- - class-variance-authority
106
- - Storybook
107
- - Vite
182
+ - React 18 + TypeScript
183
+ - Tailwind CSS 3 + class-variance-authority / clsx / tailwind-merge
184
+ - react-aria-components (Button, tabs)
185
+ - @tabler/icons-react
186
+ - Storybook 10 + Vite 7
187
+ - Vitest (browser) + Playwright Chromium
188
+ - oxlint / oxfmt