@weni/unnnic-system 3.32.0 → 3.33.1-alpha.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 (38) hide show
  1. package/.cursor/skills/unnnic/SKILL.md +222 -0
  2. package/dist/index.d.ts +3561 -7757
  3. package/dist/scss/colors-hsl.scss +179 -0
  4. package/dist/scss/colors.scss +134 -0
  5. package/dist/scss/deprecated/colors.scss +436 -0
  6. package/dist/scss/deprecated/fonts.scss +140 -0
  7. package/dist/scss/deprecated/grid.scss +52 -0
  8. package/dist/scss/deprecated/spacing.scss +103 -0
  9. package/dist/scss/fonts.scss +73 -0
  10. package/dist/scss/icon-sizes.scss +9 -0
  11. package/dist/scss/radii.scss +9 -0
  12. package/dist/scss/scheme-colors.scss +418 -0
  13. package/dist/scss/semantic-colors.scss +48 -0
  14. package/dist/scss/semantic-text-utilities.scss +26 -0
  15. package/dist/scss/shadows.scss +5 -0
  16. package/dist/scss/spaces.scss +17 -0
  17. package/dist/scss/tailwind.scss +104 -0
  18. package/dist/scss/theme.scss +98 -0
  19. package/dist/scss/unnnic.scss +20 -0
  20. package/dist/style.css +1 -1
  21. package/dist/unnnic.mjs +11448 -11797
  22. package/dist/unnnic.umd.js +32 -32
  23. package/package.json +10 -6
  24. package/src/components/AvatarIcon/AvatarIcon.vue +35 -49
  25. package/src/components/Breadcrumb/Breadcrumb.vue +20 -14
  26. package/src/components/Checkbox/Checkbox.vue +44 -57
  27. package/src/components/DatePicker/DatePicker.vue +53 -35
  28. package/src/components/DatePicker/{translations.js → translations.ts} +17 -5
  29. package/src/components/Input/BaseInput.vue +67 -75
  30. package/src/components/Input/Input.vue +84 -132
  31. package/src/components/Input/TextInput.vue +119 -136
  32. package/src/components/Input/__test__/TextInput.spec.js +10 -14
  33. package/src/components/Pagination/Pagination.vue +124 -141
  34. package/src/components/Radio/Radio.vue +36 -31
  35. package/src/components/Select/SelectItem.vue +24 -24
  36. package/src/components/SkeletonLoading/SkeletonLoading.vue +87 -88
  37. package/src/components/SkeletonLoading/skeletonTheme.vue +49 -44
  38. package/src/components/ui/table/TableRow.vue +0 -1
@@ -0,0 +1,222 @@
1
+ # Unnnic Design System
2
+
3
+ Use this skill when implementing UI with Weni's Unnnic Design System (`@weni/unnnic-system`).
4
+
5
+ ## Import
6
+
7
+ ```vue
8
+ <script setup>
9
+ import { UnnnicButton, UnnnicInput, UnnnicFormElement } from '@weni/unnnic-system';
10
+ </script>
11
+ ```
12
+
13
+ ## Priority Components
14
+
15
+ These are the most commonly used components. Use these first before looking for alternatives.
16
+
17
+ ### Form Controls
18
+
19
+ | Component | Purpose | Key Props |
20
+ |-----------|---------|-----------|
21
+ | `UnnnicButton` | Actions | `type`: primary/secondary/tertiary/warning/attention, `size`: large/small, `loading`, `disabled`, `iconLeft`, `iconRight` |
22
+ | `UnnnicInput` | Text input | `type`: normal/error, `size`: md/sm, `iconLeft`, `iconRight`, `placeholder` |
23
+ | `UnnnicFormElement` | Form wrapper | `label`, `error`, `message`, `disabled` — wrap inputs with this |
24
+ | `UnnnicTextArea` | Multiline text | `modelValue`, `maxlength` |
25
+ | `UnnnicSelect` | Dropdown select | `options`, `modelValue` |
26
+ | `UnnnicMultiSelect` | Multi Dropdown select | `options`, `modelValue` |
27
+ | `UnnnicCheckbox` | Boolean toggle | `modelValue`, `label` |
28
+ | `UnnnicCheckboxGroup` | Checkbox list | `options`, `modelValue` |
29
+ | `UnnnicRadio` | Single option | `modelValue`, `value` |
30
+ | `UnnnicRadioGroup` | Radio list | `options`, `modelValue` |
31
+ | `UnnnicSwitch` | Toggle switch | `modelValue`, `label` |
32
+ | `UnnnicDatePicker` | Date selection | `modelValue`, `format` |
33
+
34
+ ### Feedback & Overlays
35
+
36
+ | Component | Purpose | Key Props |
37
+ |-----------|---------|-----------|
38
+ | `UnnnicDialog` | Modern dialog | Composable: `DialogTrigger`, `DialogContent`, `DialogHeader`, `DialogFooter`, `DialogClose` |
39
+ | `UnnnicDrawerNext` | Modern drawer | Composable: `DrawerContent`, `DrawerHeader`, `DrawerFooter`, `DrawerClose` |
40
+ | `UnnnicToast` | Notification | Use `unnnicToastManager.show({ type, message })` |
41
+ | `UnnnicPopover` | Popover | Composable: `PopoverTrigger`, `PopoverContent` |
42
+ | `UnnnicToolTip` | Tooltip | `text`, `side` |
43
+ | `UnnnicDisclaimer` | Inline message | `type`: informational/success/attention/error/neutral, `title`, `description` |
44
+
45
+ ### Display
46
+
47
+ | Component | Purpose | Key Props |
48
+ |-----------|---------|-----------|
49
+ | `UnnnicIcon` | Icon | `icon`, `scheme`, `size`: ant/sm/md/lg/xl |
50
+ | `UnnnicChip` | Chip | `text`, `removable` |
51
+ | `UnnnicTag` | Label | `text`, `type` |
52
+ | `UnnnicSkeletonLoading` | Loading | `width`, `height` |
53
+ | `UnnnicTabs` | Modern tabs | Composable: `TabsList`, `TabsTrigger`, `TabsContent` |
54
+ | `UnnnicSegmentedControl` | Segmented toggle | Composable: `SegmentedControlList`, `SegmentedControlTrigger`, `SegmentedControlContent`, `size`: small/medium |
55
+ | `UnnnicPageHeader` | Page header | `title`, `description`, slots for actions |
56
+
57
+ ## Other Components
58
+
59
+ ### Legacy (use modern alternatives when possible)
60
+
61
+ | Legacy | Modern Alternative |
62
+ |--------|-------------------|
63
+ | `UnnnicModal` | `UnnnicDialog` |
64
+ | `UnnnicDrawer` | `UnnnicDrawerNext` |
65
+ | `UnnnicTab` | `UnnnicTabs` |
66
+ | `UnnnicSelectSmart` | `UnnnicSelect` |
67
+
68
+ ### Additional Components
69
+
70
+ | Component | Purpose | Key Props |
71
+ |-----------|---------|-----------|
72
+ | `UnnnicTable` | version="2" is Modern version="1" is Legacy | `headers`, use `UnnnicTableRow` for rows |
73
+ | `UnnnicTableNext` | Legacy table | `headers`, `items`, `@row-click`, `@sort` |
74
+ | `UnnnicDataTable` | Data table | `headers`, `items`, with pagination |
75
+ | `UnnnicBreadcrumb` | Breadcrumbs | `crumbs` array |
76
+ | `UnnnicPagination` | Page nav | `modelValue`, `total`, `perPage` |
77
+ | `UnnnicAvatarIcon` | User avatar | `username`, `size` |
78
+
79
+ ## Tokens
80
+
81
+ ### Colors (SCSS)
82
+
83
+ **Background:** `$unnnic-color-bg-{variant}`
84
+ - `base`, `base-soft`, `muted` — neutrals
85
+ - `accent-strong` — primary brand (teal)
86
+ - `success`, `warning`, `critical`, `info` — semantic
87
+
88
+ **Foreground:** `$unnnic-color-fg-{variant}`
89
+ - `base`, `emphasized`, `muted`, `inverted`
90
+ - `accent`, `success`, `warning`, `critical`, `info`
91
+
92
+ **Border:** `$unnnic-color-border-{variant}`
93
+ - `base`, `muted`, `emphasized`
94
+ - `accent-strong`, `success`, `warning`, `critical`, `info`
95
+
96
+ ### Spacing (SCSS)
97
+
98
+ `$unnnic-space-{n}` — Base unit: 4px
99
+
100
+ | Token | Value |
101
+ |-------|-------|
102
+ | `space-05` | 2px |
103
+ | `space-1` | 4px |
104
+ | `space-2` | 8px |
105
+ | `space-3` | 12px |
106
+ | `space-4` | 16px |
107
+ | `space-6` | 24px |
108
+ | `space-8` | 32px |
109
+ | `space-12` | 48px |
110
+ | `space-16` | 64px |
111
+ | `space-20` | 80px |
112
+
113
+ ### Icon sizer (SCSS)
114
+
115
+ `$unnnic-icon-size-{n}` — Base unit: 4px
116
+
117
+ | Token | Value |
118
+ |-------|-------|
119
+ | `size-3` | 12px |
120
+ | `size-4` | 16px |
121
+ | `size-5` | 20px |
122
+ | `size-6` | 24px |
123
+ | `size-7` | 32px |
124
+ | `size-10` | 40px |
125
+
126
+ ### Typography (SCSS mixins)
127
+
128
+ ```scss
129
+ @include unnnic-font-display-1; // 24px bold
130
+ @include unnnic-font-display-2; // 20px semibold
131
+ @include unnnic-font-body; // 14px regular
132
+ @include unnnic-font-caption-1; // 12px regular
133
+ @include unnnic-font-action; // 14px semibold (buttons)
134
+ ```
135
+
136
+ ### Radii
137
+
138
+ `$unnnic-radius-{n}` — 1, 2, 3, 4 or full (4px increments)
139
+
140
+ ### Shadows
141
+
142
+ `$unnnic-shadow-{n}` — 1 or 2
143
+
144
+ ## Patterns
145
+
146
+ ### Form with Validation
147
+
148
+ ```vue
149
+ <UnnnicFormElement label="Email" :error="errors.email">
150
+ <UnnnicInput
151
+ v-model="email"
152
+ :type="errors.email ? 'error' : 'normal'"
153
+ placeholder="user@example.com"
154
+ />
155
+ </UnnnicFormElement>
156
+ ```
157
+
158
+ ### Button Hierarchy
159
+
160
+ - **Primary action:** `type="primary"` — one per section
161
+ - **Secondary action:** `type="secondary"`
162
+ - **Tertiary/link:** `type="tertiary"`
163
+ - **Destructive:** `type="warning"`
164
+ - **Caution:** `type="attention"`
165
+
166
+ ### Toast Notifications
167
+
168
+ ```typescript
169
+ import { unnnicToastManager } from '@weni/unnnic-system';
170
+
171
+ unnnicToastManager.show({
172
+ type: 'success', // success | error | warning | info
173
+ message: 'Changes saved',
174
+ });
175
+ ```
176
+
177
+ ### Modern Composable Components
178
+
179
+ Newer components use composable patterns:
180
+
181
+ ```vue
182
+ <UnnnicDialog>
183
+ <UnnnicDialogTrigger>
184
+ <UnnnicButton>Open</UnnnicButton>
185
+ </UnnnicDialogTrigger>
186
+ <UnnnicDialogContent>
187
+ <UnnnicDialogHeader>
188
+ <UnnnicDialogTitle>Title</UnnnicDialogTitle>
189
+ </UnnnicDialogHeader>
190
+ <!-- content -->
191
+ <UnnnicDialogFooter>
192
+ <UnnnicDialogClose>
193
+ <UnnnicButton type="secondary">Cancel</UnnnicButton>
194
+ </UnnnicDialogClose>
195
+ <UnnnicButton type="primary">Confirm</UnnnicButton>
196
+ </UnnnicDialogFooter>
197
+ </UnnnicDialogContent>
198
+ </UnnnicDialog>
199
+ ```
200
+
201
+ ## Figma Integration
202
+
203
+ When implementing from Figma designs:
204
+
205
+ 1. Use Figma MCP `get_design_context` to get component structure
206
+ 2. Match Figma component names to Unnnic exports (e.g., "Button" → `UnnnicButton`)
207
+ 3. Use semantic tokens — never hardcode colors
208
+ 4. Check for Code Connect snippets in Figma Dev Mode
209
+
210
+ ## Common Mistakes to Avoid
211
+
212
+ - Don't use raw `<input>` — use `UnnnicInput` wrapped in `UnnnicFormElement`
213
+ - Don't hardcode colors — use `$unnnic-color-*` tokens
214
+ - Don't use multiple `type="primary"` buttons in same section
215
+ - Don't forget error states — pass `error` prop to `UnnnicFormElement`
216
+ - Don't use legacy `UnnnicModal` for new code — prefer `UnnnicModalNext` or `UnnnicDialog`
217
+
218
+ ## Resources
219
+
220
+ - **Storybook:** https://unnnic.stg.cloud.weni.ai/
221
+ - **Figma:** https://figma.com/design/YbvOpVPUBxTSEzg4J8pXKu/Weni---unnnic
222
+ - **npm:** https://www.npmjs.com/package/@weni/unnnic-system