@wallarm-org/design-system 4.20.1 → 4.20.2-rc-feat-CORE-2785.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.
|
@@ -14,7 +14,7 @@ import { navRailItemCompactLabelClassName, navRailItemVariants } from "./classes
|
|
|
14
14
|
import { useNavRailContext } from "./NavRailContext.js";
|
|
15
15
|
import { useShortcut } from "./useShortcut.js";
|
|
16
16
|
const NavRailItem = (t0)=>{
|
|
17
|
-
const $ = c(
|
|
17
|
+
const $ = c(61);
|
|
18
18
|
let Icon;
|
|
19
19
|
let avatarSrc;
|
|
20
20
|
let children;
|
|
@@ -175,59 +175,71 @@ const NavRailItem = (t0)=>{
|
|
|
175
175
|
$[45] = t12;
|
|
176
176
|
} else t12 = $[45];
|
|
177
177
|
const element = t12;
|
|
178
|
+
const hasShortcut = !!shortcut?.length;
|
|
178
179
|
let t13;
|
|
179
|
-
if ($[46]
|
|
180
|
-
t13 = {
|
|
180
|
+
if ($[46] !== element || $[47] !== props) {
|
|
181
|
+
t13 = props["aria-haspopup"] ? /*#__PURE__*/ jsx("span", {
|
|
182
|
+
className: "flex flex-1",
|
|
183
|
+
children: element
|
|
184
|
+
}) : element;
|
|
185
|
+
$[46] = element;
|
|
186
|
+
$[47] = props;
|
|
187
|
+
$[48] = t13;
|
|
188
|
+
} else t13 = $[48];
|
|
189
|
+
const trigger = t13;
|
|
190
|
+
if (showsLabel && !hasShortcut) return trigger;
|
|
191
|
+
let t14;
|
|
192
|
+
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
193
|
+
t14 = {
|
|
181
194
|
placement: "right"
|
|
182
195
|
};
|
|
183
|
-
$[46] = t13;
|
|
184
|
-
} else t13 = $[46];
|
|
185
|
-
let t14;
|
|
186
|
-
if ($[47] !== element || $[48] !== props) {
|
|
187
|
-
t14 = /*#__PURE__*/ jsx(TooltipTrigger, {
|
|
188
|
-
asChild: true,
|
|
189
|
-
children: props["aria-haspopup"] ? /*#__PURE__*/ jsx("span", {
|
|
190
|
-
className: "flex flex-1",
|
|
191
|
-
children: element
|
|
192
|
-
}) : element
|
|
193
|
-
});
|
|
194
|
-
$[47] = element;
|
|
195
|
-
$[48] = props;
|
|
196
196
|
$[49] = t14;
|
|
197
197
|
} else t14 = $[49];
|
|
198
198
|
let t15;
|
|
199
|
-
if ($[50] !==
|
|
200
|
-
t15 =
|
|
201
|
-
|
|
199
|
+
if ($[50] !== trigger) {
|
|
200
|
+
t15 = /*#__PURE__*/ jsx(TooltipTrigger, {
|
|
201
|
+
asChild: true,
|
|
202
|
+
children: trigger
|
|
203
|
+
});
|
|
204
|
+
$[50] = trigger;
|
|
202
205
|
$[51] = t15;
|
|
203
206
|
} else t15 = $[51];
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
+
const t16 = !showsLabel && label;
|
|
208
|
+
const t17 = !showsLabel && hasShortcut && " ";
|
|
209
|
+
let t18;
|
|
210
|
+
if ($[52] !== shortcut) {
|
|
211
|
+
t18 = shortcut?.map(_temp);
|
|
212
|
+
$[52] = shortcut;
|
|
213
|
+
$[53] = t18;
|
|
214
|
+
} else t18 = $[53];
|
|
215
|
+
let t19;
|
|
216
|
+
if ($[54] !== t16 || $[55] !== t17 || $[56] !== t18) {
|
|
217
|
+
t19 = /*#__PURE__*/ jsxs(TooltipContent, {
|
|
207
218
|
children: [
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
t16,
|
|
220
|
+
t17,
|
|
221
|
+
t18
|
|
211
222
|
]
|
|
212
223
|
});
|
|
213
|
-
$[52] = label;
|
|
214
|
-
$[53] = t15;
|
|
215
224
|
$[54] = t16;
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
225
|
+
$[55] = t17;
|
|
226
|
+
$[56] = t18;
|
|
227
|
+
$[57] = t19;
|
|
228
|
+
} else t19 = $[57];
|
|
229
|
+
let t20;
|
|
230
|
+
if ($[58] !== t15 || $[59] !== t19) {
|
|
231
|
+
t20 = /*#__PURE__*/ jsxs(Tooltip, {
|
|
232
|
+
positioning: t14,
|
|
221
233
|
children: [
|
|
222
|
-
|
|
223
|
-
|
|
234
|
+
t15,
|
|
235
|
+
t19
|
|
224
236
|
]
|
|
225
237
|
});
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
} else
|
|
230
|
-
return
|
|
238
|
+
$[58] = t15;
|
|
239
|
+
$[59] = t19;
|
|
240
|
+
$[60] = t20;
|
|
241
|
+
} else t20 = $[60];
|
|
242
|
+
return t20;
|
|
231
243
|
};
|
|
232
244
|
NavRailItem.displayName = "NavRailItem";
|
|
233
245
|
function _temp(key, index) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.20.
|
|
2
|
+
"version": "4.20.1",
|
|
3
3
|
"rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
|
|
4
4
|
"guidelines": [
|
|
5
5
|
{
|
package/package.json
CHANGED