@zyncat/ui 0.15.0 → 0.17.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.
- package/README.md +32 -202
- package/dist/alert.css +1 -1
- package/dist/alert.js +18 -10
- package/dist/alert.js.map +1 -1
- package/dist/avatar.css +3 -2
- package/dist/badge.css +1 -1
- package/dist/bloom-HV23M4AW.js +81 -0
- package/dist/bloom-HV23M4AW.js.map +1 -0
- package/dist/button.css +21 -24
- package/dist/button.js +3 -1
- package/dist/checkbox.css +1 -1
- package/dist/chunk-2YGHPQ66.js +16 -0
- package/dist/chunk-2YGHPQ66.js.map +1 -0
- package/dist/{chunk-K45CWVHS.js → chunk-3MLUH2QL.js} +4 -4
- package/dist/{chunk-K45CWVHS.js.map → chunk-3MLUH2QL.js.map} +1 -1
- package/dist/{chunk-FVPNICF4.js → chunk-4PQDVK23.js} +4 -4
- package/dist/{chunk-FVPNICF4.js.map → chunk-4PQDVK23.js.map} +1 -1
- package/dist/{chunk-FLQVOSFC.js → chunk-6IXLW7QA.js} +7 -7
- package/dist/{chunk-FLQVOSFC.js.map → chunk-6IXLW7QA.js.map} +1 -1
- package/dist/chunk-7NHY2CRA.js +132 -0
- package/dist/chunk-7NHY2CRA.js.map +1 -0
- package/dist/{chunk-BH4JFWXQ.js → chunk-7VTWJL72.js} +19 -16
- package/dist/chunk-7VTWJL72.js.map +1 -0
- package/dist/chunk-7ZSIUUC3.js +50 -0
- package/dist/chunk-7ZSIUUC3.js.map +1 -0
- package/dist/{chunk-6X3G4GIM.js → chunk-DH7DT6EO.js} +3 -3
- package/dist/{chunk-6X3G4GIM.js.map → chunk-DH7DT6EO.js.map} +1 -1
- package/dist/{chunk-QGVFFT2B.js → chunk-EOWWVFBF.js} +3 -3
- package/dist/{chunk-QGVFFT2B.js.map → chunk-EOWWVFBF.js.map} +1 -1
- package/dist/{chunk-RBSHRRNO.js → chunk-FLDIRXFU.js} +5 -5
- package/dist/{chunk-RBSHRRNO.js.map → chunk-FLDIRXFU.js.map} +1 -1
- package/dist/{chunk-5GBV45YD.js → chunk-GWCBTD63.js} +3 -3
- package/dist/{chunk-5GBV45YD.js.map → chunk-GWCBTD63.js.map} +1 -1
- package/dist/chunk-GZ6UMHCK.js +103 -0
- package/dist/chunk-GZ6UMHCK.js.map +1 -0
- package/dist/{chunk-FEXUS4SV.js → chunk-HWDIVGME.js} +11 -5
- package/dist/chunk-HWDIVGME.js.map +1 -0
- package/dist/chunk-KSAJ6DED.js +16 -0
- package/dist/chunk-KSAJ6DED.js.map +1 -0
- package/dist/{chunk-UYSXJ7MH.js → chunk-LH2UIEKN.js} +7 -17
- package/dist/chunk-LH2UIEKN.js.map +1 -0
- package/dist/{chunk-CAXQJSIE.js → chunk-M2A6PZ7J.js} +6 -6
- package/dist/{chunk-CAXQJSIE.js.map → chunk-M2A6PZ7J.js.map} +1 -1
- package/dist/chunk-NYQQH4R5.js +40 -0
- package/dist/chunk-NYQQH4R5.js.map +1 -0
- package/dist/{chunk-BTF6DAE3.js → chunk-ODRO3KS6.js} +4 -4
- package/dist/{chunk-BTF6DAE3.js.map → chunk-ODRO3KS6.js.map} +1 -1
- package/dist/{chunk-GJTHWB6O.js → chunk-QDAN43B6.js} +3 -3
- package/dist/{chunk-GJTHWB6O.js.map → chunk-QDAN43B6.js.map} +1 -1
- package/dist/{chunk-MDSRZ4QR.js → chunk-RY35IU3G.js} +3 -3
- package/dist/{chunk-MDSRZ4QR.js.map → chunk-RY35IU3G.js.map} +1 -1
- package/dist/{chunk-GOLSYGRA.js → chunk-TBLPZQSI.js} +84 -48
- package/dist/chunk-TBLPZQSI.js.map +1 -0
- package/dist/{chunk-5X3MJRIM.js → chunk-UKPX3RIP.js} +3 -3
- package/dist/{chunk-5X3MJRIM.js.map → chunk-UKPX3RIP.js.map} +1 -1
- package/dist/{chunk-CFRGQJ23.js → chunk-VZXML7EH.js} +4 -4
- package/dist/{chunk-CFRGQJ23.js.map → chunk-VZXML7EH.js.map} +1 -1
- package/dist/{chunk-PWQVSVXR.js → chunk-WC45VSST.js} +8 -8
- package/dist/{chunk-PWQVSVXR.js.map → chunk-WC45VSST.js.map} +1 -1
- package/dist/chunk-WQKWPI6V.js +196 -0
- package/dist/chunk-WQKWPI6V.js.map +1 -0
- package/dist/{chunk-N2GJEO5Z.js → chunk-ZHMOH62S.js} +4 -4
- package/dist/chunk-ZHMOH62S.js.map +1 -0
- package/dist/cli.js +259 -43
- package/dist/collapse.css +8 -5
- package/dist/confetti.css +3 -3
- package/dist/confetti.js +2 -2
- package/dist/date-field.js +16 -14
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.css +168 -43
- package/dist/date-range-field.js +38 -23
- package/dist/date-range-field.js.map +1 -1
- package/dist/datetime-field.js +17 -15
- package/dist/datetime-field.js.map +1 -1
- package/dist/dialog.css +4 -3
- package/dist/dialog.js +8 -8
- package/dist/digit-strip.css +1 -1
- package/dist/dropdown.css +1 -1
- package/dist/dropdown.js +8 -8
- package/dist/emoji-picker.js +14 -14
- package/dist/facebook-feed.css +1 -1
- package/dist/flow-field.css +4 -4
- package/dist/flow-field.js +3 -3
- package/dist/flow-field.js.map +1 -1
- package/dist/glide.js +3 -3
- package/dist/icon.css +1 -1
- package/dist/input.css +7 -4
- package/dist/instagram-feed.css +1 -1
- package/dist/instagram-feed.js +2 -2
- package/dist/lens.css +1 -2
- package/dist/lens.js +2 -2
- package/dist/mcp.js +1 -1
- package/dist/menu-surface.css +1 -1
- package/dist/modal.css +1 -1
- package/dist/modal.js +6 -6
- package/dist/morphing-text.css +2 -2
- package/dist/morphing-text.js +2 -2
- package/dist/motion-devtools.css +77 -2
- package/dist/motion-devtools.js +194 -37
- package/dist/motion-devtools.js.map +1 -1
- package/dist/motion-tokens.js +1 -1
- package/dist/multi-select.js +9 -9
- package/dist/number-field.js +3 -3
- package/dist/odometer.css +1 -1
- package/dist/odometer.js +2 -2
- package/dist/overlay.css +1 -1
- package/dist/pagination.css +1 -1
- package/dist/pagination.js +6 -4
- package/dist/pagination.js.map +1 -1
- package/dist/paint-CJQCM6ZO.js +260 -0
- package/dist/paint-CJQCM6ZO.js.map +1 -0
- package/dist/popover.css +1 -1
- package/dist/popover.js +6 -6
- package/dist/radio-group.css +6 -4
- package/dist/radio-group.js +6 -6
- package/dist/select.css +1 -1
- package/dist/select.js +9 -9
- package/dist/sheet.css +1 -1
- package/dist/sheet.js +7 -7
- package/dist/spinner.css +115 -0
- package/dist/spinner.js +4 -0
- package/dist/spinner.js.map +1 -0
- package/dist/status-badge.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/support-rail.css +76 -238
- package/dist/support-rail.js +97 -105
- package/dist/support-rail.js.map +1 -1
- package/dist/table.css +2 -2
- package/dist/table.js +8 -6
- package/dist/table.js.map +1 -1
- package/dist/tabs.css +10 -14
- package/dist/tabs.js +6 -6
- package/dist/tag.css +1 -1
- package/dist/tag.js +6 -6
- package/dist/text-field.js +3 -3
- package/dist/textarea.css +1 -1
- package/dist/textarea.js +2 -2
- package/dist/theme-grid.js +11 -0
- package/dist/theme-grid.js.map +1 -0
- package/dist/theme-switcher.css +107 -0
- package/dist/theme-switcher.js +70 -0
- package/dist/theme-switcher.js.map +1 -0
- package/dist/theme-transition-LLC644ZR.js +346 -0
- package/dist/theme-transition-LLC644ZR.js.map +1 -0
- package/dist/theme-transition.css +48 -0
- package/dist/theme.js +57 -26
- package/dist/theme.js.map +1 -1
- package/dist/tide-DJZMDAFT.js +57 -0
- package/dist/tide-DJZMDAFT.js.map +1 -0
- package/dist/tiktok.css +2 -3
- package/dist/tiktok.js +2 -2
- package/dist/time-field.js +4 -4
- package/dist/toast.css +2 -14
- package/dist/toast.js +11 -9
- package/dist/toast.js.map +1 -1
- package/dist/toggle-tag.js +2 -2
- package/dist/toggle.css +1 -1
- package/dist/tooltip.css +1 -1
- package/dist/tooltip.js +5 -5
- package/dist/trigger.css +1 -1
- package/dist/types/components/composites/date-picker/month-jump.d.ts +11 -0
- package/dist/types/components/composites/theme-switcher/ThemeGrid.d.ts +20 -0
- package/dist/types/components/composites/theme-switcher/ThemeSwitcher.d.ts +24 -0
- package/dist/types/components/compound/support-rail/SupportRail.d.ts +10 -8
- package/dist/types/components/dev/MotionDevtools.d.ts +10 -5
- package/dist/types/components/expressive/theme-transition/bloom.d.ts +2 -0
- package/dist/types/components/expressive/theme-transition/paint.d.ts +2 -0
- package/dist/types/components/expressive/theme-transition/scene.d.ts +24 -0
- package/dist/types/components/expressive/theme-transition/theme-transition.d.ts +19 -0
- package/dist/types/components/expressive/theme-transition/tide.d.ts +2 -0
- package/dist/types/components/internal/icon/Icon.d.ts +1 -0
- package/dist/types/components/primitives/button/Button.d.ts +9 -12
- package/dist/types/components/primitives/button/button-style.d.ts +15 -0
- package/dist/types/components/primitives/spinner/Spinner.d.ts +27 -0
- package/dist/types/engine/animate.d.ts +1 -0
- package/dist/types/tokens/component-styles.generated.d.ts +35 -38
- package/dist/types/tokens/motion-tokens.d.ts +2 -2
- package/dist/types/tokens/theme-store.d.ts +47 -0
- package/dist/types/tokens/theme-sync.d.ts +7 -1
- package/dist/types/tokens/theme-tokens.generated.d.ts +121 -109
- package/dist/types/tokens/theme.d.ts +28 -5
- package/dist/typing-lines.css +1 -1
- package/dist/typing-lines.js +2 -2
- package/dist/weight-field.css +2 -2
- package/dist/youtube.css +1 -1
- package/dist/youtube.js +2 -2
- package/package.json +25 -31
- package/skills/zyncat-ui/references/components.md +5 -2
- package/src/components/composites/alert/Alert.tsx +7 -3
- package/src/components/composites/alert/alert.css +1 -1
- package/src/components/composites/date-picker/calendar-panel.tsx +10 -4
- package/src/components/composites/date-picker/date-picker.css +168 -43
- package/src/components/composites/date-picker/month-jump.tsx +192 -0
- package/src/components/composites/date-picker/range-panel.tsx +20 -5
- package/src/components/composites/dialog/dialog.css +4 -3
- package/src/components/composites/dropdown/dropdown.css +1 -1
- package/src/components/composites/emoji-picker/styles.css +1 -1
- package/src/components/composites/modal/modal.css +1 -1
- package/src/components/composites/pagination/pagination.css +1 -1
- package/src/components/composites/popover/popover.css +1 -1
- package/src/components/composites/select/select.css +1 -1
- package/src/components/composites/sheet/sheet.css +1 -1
- package/src/components/composites/table/table.css +2 -2
- package/src/components/composites/tabs/tabs.css +10 -14
- package/src/components/composites/theme-switcher/ThemeGrid.tsx +133 -0
- package/src/components/composites/theme-switcher/ThemeGrid.usage.md +20 -0
- package/src/components/composites/theme-switcher/ThemeSwitcher.tsx +75 -0
- package/src/components/composites/theme-switcher/ThemeSwitcher.usage.md +21 -0
- package/src/components/composites/theme-switcher/theme-switcher.css +107 -0
- package/src/components/composites/toast/Toast.tsx +2 -1
- package/src/components/composites/toast/toast.css +2 -14
- package/src/components/composites/tooltip/tooltip.css +1 -1
- package/src/components/compound/support-rail/SupportRail.tsx +116 -128
- package/src/components/compound/support-rail/SupportRail.usage.md +7 -6
- package/src/components/compound/support-rail/support-rail.css +76 -238
- package/src/components/dev/MotionDevtools.tsx +252 -42
- package/src/components/dev/MotionDevtools.usage.md +12 -4
- package/src/components/dev/motion-devtools.css +77 -2
- package/src/components/dev/slowmo-engine.ts +1 -1
- package/src/components/expressive/confetti/confetti.css +3 -3
- package/src/components/expressive/facebook-feed/facebook-feed.css +1 -1
- package/src/components/expressive/flow-field/FlowField.tsx +1 -1
- package/src/components/expressive/flow-field/flow-field.css +4 -4
- package/src/components/expressive/instagram-feed/instagram-feed.css +1 -1
- package/src/components/expressive/lens/lens.css +1 -2
- package/src/components/expressive/morphing-text/morphing-text.css +2 -2
- package/src/components/expressive/odometer/odometer.css +1 -1
- package/src/components/expressive/theme-transition/bloom.ts +88 -0
- package/src/components/expressive/theme-transition/paint.ts +296 -0
- package/src/components/expressive/theme-transition/scene.ts +38 -0
- package/src/components/expressive/theme-transition/theme-transition.css +48 -0
- package/src/components/expressive/theme-transition/theme-transition.ts +423 -0
- package/src/components/expressive/theme-transition/tide.ts +65 -0
- package/src/components/expressive/tiktok/tiktok.css +2 -3
- package/src/components/expressive/typing-lines/typing-lines.css +1 -1
- package/src/components/expressive/weight-field/weight-field.css +2 -2
- package/src/components/expressive/youtube/youtube.css +1 -1
- package/src/components/internal/glass/glass.css +1 -1
- package/src/components/internal/icon/Icon.tsx +2 -0
- package/src/components/internal/icon/icon.css +1 -1
- package/src/components/internal/menu/menu-surface.css +1 -1
- package/src/components/internal/overlay/overlay.css +1 -1
- package/src/components/internal/overlay/trigger.css +1 -1
- package/src/components/primitives/avatar/avatar.css +3 -2
- package/src/components/primitives/badge/badge.css +1 -1
- package/src/components/primitives/badge/digit-strip.css +1 -1
- package/src/components/primitives/button/Button.tsx +12 -26
- package/src/components/primitives/button/button-style.ts +28 -0
- package/src/components/primitives/button/button.css +21 -24
- package/src/components/primitives/checkbox/checkbox.css +1 -1
- package/src/components/primitives/collapse/collapse.css +8 -5
- package/src/components/primitives/input/input.css +7 -4
- package/src/components/primitives/radio-group/radio-group.css +6 -4
- package/src/components/primitives/spinner/Spinner.tsx +70 -0
- package/src/components/primitives/spinner/Spinner.usage.md +19 -0
- package/src/components/primitives/spinner/spinner.css +115 -0
- package/src/components/primitives/tag/tag.css +1 -1
- package/src/components/primitives/textarea/textarea.css +1 -1
- package/src/components/primitives/toggle/toggle.css +1 -1
- package/src/engine/animate.ts +10 -2
- package/src/mcp/server.ts +2 -1
- package/src/styles.css +3 -3
- package/src/tokens/base.css +5 -5
- package/src/tokens/color.css +8 -9
- package/src/tokens/component-styles.generated.ts +36 -38
- package/src/tokens/dark.css +8 -13
- package/src/tokens/decisions.css +5 -8
- package/src/tokens/elevation.css +18 -26
- package/src/tokens/glass.css +3 -2
- package/src/tokens/motion-defaults.generated.ts +1 -1
- package/src/tokens/motion-tokens.ts +3 -3
- package/src/tokens/motion.css +9 -9
- package/src/tokens/radius.css +3 -2
- package/src/tokens/reset.css +36 -0
- package/src/tokens/semantic.css +10 -18
- package/src/tokens/spacing.css +1 -1
- package/src/tokens/theme-store.ts +187 -0
- package/src/tokens/theme-sync.tsx +49 -2
- package/src/tokens/theme-tokens.generated.ts +124 -110
- package/src/tokens/theme.tsx +96 -24
- package/src/tokens/theme.usage.md +25 -24
- package/src/tokens/typography.css +4 -3
- package/tailwind.css +7 -13
- package/dist/chunk-6SUHSSOK.js +0 -25
- package/dist/chunk-6SUHSSOK.js.map +0 -1
- package/dist/chunk-BH4JFWXQ.js.map +0 -1
- package/dist/chunk-FEXUS4SV.js.map +0 -1
- package/dist/chunk-GOLSYGRA.js.map +0 -1
- package/dist/chunk-N2GJEO5Z.js.map +0 -1
- package/dist/chunk-UYSXJ7MH.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1506,6 +1506,99 @@ function gradientText(text, from, to) {
|
|
|
1506
1506
|
return chars.map((char, i2) => fg(lerpHex(from, to, i2 / span))(char)).join("");
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
|
+
// src/theme-file.ts
|
|
1510
|
+
var BASELINE_VERSION = "0.15.0";
|
|
1511
|
+
var TOKEN_HISTORY = {};
|
|
1512
|
+
var ROOT_BLOCK = /^[ \t]*:root\b[^{]*\{/m;
|
|
1513
|
+
var STAMP = /@zyncat-ui\s+(\d+\.\d+\.\d+)/;
|
|
1514
|
+
var COMMENT_OR_DECLARATION = /\/\*[\s\S]*?\*\/|(--[\w-]+)\s*:\s*([^;]+);/g;
|
|
1515
|
+
var COMMENT_OR_NAME = /\/\*[\s\S]*?\*\/|(--[\w-]+)\s*:/g;
|
|
1516
|
+
function rootBlock(css) {
|
|
1517
|
+
const rule = ROOT_BLOCK.exec(css);
|
|
1518
|
+
if (!rule) return null;
|
|
1519
|
+
const start = rule.index + rule[0].length;
|
|
1520
|
+
let depth = 1;
|
|
1521
|
+
for (let i2 = start; i2 < css.length; i2++) {
|
|
1522
|
+
if (css[i2] === "{") depth++;
|
|
1523
|
+
else if (css[i2] === "}" && --depth === 0) return { start, end: i2 };
|
|
1524
|
+
}
|
|
1525
|
+
return null;
|
|
1526
|
+
}
|
|
1527
|
+
function parseDecisions(css) {
|
|
1528
|
+
const block2 = rootBlock(css);
|
|
1529
|
+
if (!block2) return [];
|
|
1530
|
+
const body = css.slice(block2.start, block2.end);
|
|
1531
|
+
const decisions = [];
|
|
1532
|
+
let comment = "";
|
|
1533
|
+
COMMENT_OR_DECLARATION.lastIndex = 0;
|
|
1534
|
+
for (let match = COMMENT_OR_DECLARATION.exec(body); match; match = COMMENT_OR_DECLARATION.exec(body)) {
|
|
1535
|
+
if (match[1] === void 0) {
|
|
1536
|
+
comment = match[0];
|
|
1537
|
+
continue;
|
|
1538
|
+
}
|
|
1539
|
+
decisions.push({ name: match[1], value: match[2].trim(), comment });
|
|
1540
|
+
comment = "";
|
|
1541
|
+
}
|
|
1542
|
+
return decisions;
|
|
1543
|
+
}
|
|
1544
|
+
function declaredNames(css) {
|
|
1545
|
+
const names = /* @__PURE__ */ new Set();
|
|
1546
|
+
COMMENT_OR_NAME.lastIndex = 0;
|
|
1547
|
+
for (let match = COMMENT_OR_NAME.exec(css); match; match = COMMENT_OR_NAME.exec(css))
|
|
1548
|
+
if (match[1] !== void 0) names.add(match[1]);
|
|
1549
|
+
return names;
|
|
1550
|
+
}
|
|
1551
|
+
var readStamp = (css) => STAMP.exec(css)?.[1] ?? null;
|
|
1552
|
+
var stampOf = (css) => readStamp(css) ?? BASELINE_VERSION;
|
|
1553
|
+
function themeDrift(existing, shipped) {
|
|
1554
|
+
const declared = declaredNames(existing);
|
|
1555
|
+
const stamp = stampOf(existing);
|
|
1556
|
+
const added = shipped.filter((decision) => {
|
|
1557
|
+
if (declared.has(decision.name)) return false;
|
|
1558
|
+
const since = TOKEN_HISTORY[decision.name]?.since;
|
|
1559
|
+
return since !== void 0 && isOlder(stamp, since);
|
|
1560
|
+
});
|
|
1561
|
+
const deprecated = [];
|
|
1562
|
+
const removed = [];
|
|
1563
|
+
for (const name of declared) {
|
|
1564
|
+
const note = TOKEN_HISTORY[name];
|
|
1565
|
+
if (!note) continue;
|
|
1566
|
+
if (note.removed) removed.push({ name, note });
|
|
1567
|
+
else if (note.deprecated) deprecated.push({ name, note });
|
|
1568
|
+
}
|
|
1569
|
+
return { added, deprecated, removed };
|
|
1570
|
+
}
|
|
1571
|
+
function renderDecision(decision, indent) {
|
|
1572
|
+
const comment = decision.comment ? `${decision.comment.split("\n").map((line, index) => `${indent}${index === 0 ? "" : " "}${line.trim()}`).join("\n")}
|
|
1573
|
+
` : "";
|
|
1574
|
+
return `${comment}${indent}${decision.name}: ${decision.value};`;
|
|
1575
|
+
}
|
|
1576
|
+
function stampCss(css, version2) {
|
|
1577
|
+
if (STAMP.test(css)) return css.replace(STAMP, `@zyncat-ui ${version2}`);
|
|
1578
|
+
const header = /^\s*\/\*[\s\S]*?\*\//.exec(css);
|
|
1579
|
+
const line = `@zyncat-ui ${version2} - the version whose decisions this mirrors; \`npx zyncat-ui update\` refreshes it.`;
|
|
1580
|
+
if (!header) return `/* ${line} */
|
|
1581
|
+
${css}`;
|
|
1582
|
+
const close = header.index + header[0].length - 2;
|
|
1583
|
+
return `${css.slice(0, close).trimEnd()}
|
|
1584
|
+
${line} */${css.slice(close + 2)}`;
|
|
1585
|
+
}
|
|
1586
|
+
function withDecisions(css, decisions, version2) {
|
|
1587
|
+
const stamped = stampCss(css, version2);
|
|
1588
|
+
if (!decisions.length) return stamped;
|
|
1589
|
+
const body = decisions.map((decision) => renderDecision(decision, " ")).join("\n");
|
|
1590
|
+
const block2 = rootBlock(stamped);
|
|
1591
|
+
if (!block2) return `${stamped.trimEnd()}
|
|
1592
|
+
|
|
1593
|
+
:root {
|
|
1594
|
+
${body}
|
|
1595
|
+
}
|
|
1596
|
+
`;
|
|
1597
|
+
return `${stamped.slice(0, block2.end).trimEnd()}
|
|
1598
|
+
${body}
|
|
1599
|
+
${stamped.slice(block2.end)}`;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1509
1602
|
// src/ui.ts
|
|
1510
1603
|
var SPINNER_FRAMES = unicode ? ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"] : ["-", "\\", "|", "/"];
|
|
1511
1604
|
var SPINNER_DELAY = 80;
|
|
@@ -1598,6 +1691,31 @@ var ADD_COMMAND = {
|
|
|
1598
1691
|
yarn: "yarn add",
|
|
1599
1692
|
bun: "bun add"
|
|
1600
1693
|
};
|
|
1694
|
+
function removedWarning(removed) {
|
|
1695
|
+
const one = removed.length === 1;
|
|
1696
|
+
const named = removed.map(({ name, note }) => `${name} (removed in ${note.removed}${note.use ? ` - use ${note.use}` : ""})`).join(", ");
|
|
1697
|
+
const lead = one ? "A token your theme file sets no longer exists" : `${removed.length} tokens your theme file sets no longer exist`;
|
|
1698
|
+
return `${lead}: ${named}. Nothing reads ${one ? "it" : "them"} now, so ${one ? "that line is" : "those lines are"} dead.`;
|
|
1699
|
+
}
|
|
1700
|
+
function deprecatedNote(deprecated) {
|
|
1701
|
+
const one = deprecated.length === 1;
|
|
1702
|
+
const named = deprecated.map(({ name, note }) => `${name} (deprecated in ${note.deprecated}${note.use ? ` - now feeds ${note.use}` : ""})`).join(", ");
|
|
1703
|
+
const lead = one ? "A token your theme file sets is deprecated" : `${deprecated.length} tokens are deprecated`;
|
|
1704
|
+
return `${lead}: ${named}. ${one ? "It still works" : "They still work"} - rename ${one ? "it" : "them"} before the alias goes.`;
|
|
1705
|
+
}
|
|
1706
|
+
var minorOf = (version2) => Number(version2.split(".")[1] ?? 0);
|
|
1707
|
+
function crossedVersions(before, after) {
|
|
1708
|
+
const minors = minorOf(after) - minorOf(before);
|
|
1709
|
+
if (minors < 1) return row("Upgraded", `${before} ${arrow} ${after}`);
|
|
1710
|
+
const releases = `${minors} minor release${minors === 1 ? "" : "s"}`;
|
|
1711
|
+
return row("Upgraded", `${before} ${arrow} ${after} \xB7 ${releases}, each breaking before 1.0`);
|
|
1712
|
+
}
|
|
1713
|
+
function driftHint(drift, command2) {
|
|
1714
|
+
const one = drift.added.length === 1;
|
|
1715
|
+
const names = drift.added.map((decision) => decision.name).join(", ");
|
|
1716
|
+
const running = one ? "it already runs on its default" : "each already runs on its default";
|
|
1717
|
+
return `${names} - ${running}, so nothing is broken. ${command2} adds ${one ? "it" : "them"} to your file.`;
|
|
1718
|
+
}
|
|
1601
1719
|
async function planInstall(cwd, targetPkg, flags, version2) {
|
|
1602
1720
|
const deps = { ...targetPkg.dependencies, ...targetPkg.devDependencies };
|
|
1603
1721
|
const specs = [];
|
|
@@ -1725,7 +1843,7 @@ function wireSkill(cwd, packageRoot, pm) {
|
|
|
1725
1843
|
return {
|
|
1726
1844
|
line: row("Agent skill", `skipped \xB7 ${PACKAGE}${onDisk ? ` ${onDisk}` : ""} ships no skills/`),
|
|
1727
1845
|
done: false,
|
|
1728
|
-
|
|
1846
|
+
hints: [`Upgrade it with ${ADD_COMMAND[pm]} ${PACKAGE}@latest, then re-run init.`]
|
|
1729
1847
|
};
|
|
1730
1848
|
}
|
|
1731
1849
|
const dest = join3(cwd, ".claude/skills");
|
|
@@ -1749,11 +1867,12 @@ function wireMcp(cwd) {
|
|
|
1749
1867
|
`);
|
|
1750
1868
|
return { line: row("MCP server", existed ? ".mcp.json \xB7 kept" : `.mcp.json ${arrow} zyncat-ui`), done: true };
|
|
1751
1869
|
}
|
|
1752
|
-
function
|
|
1870
|
+
function shippedDecisionsCss(packageRoot) {
|
|
1753
1871
|
const source = join3(packageRoot, THEME_SOURCE);
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1872
|
+
return existsSync3(source) ? readFileSync2(source, "utf8") : null;
|
|
1873
|
+
}
|
|
1874
|
+
function themeFileText(css, version2) {
|
|
1875
|
+
const rule = /^\s*:root\b[^{]*\{/m.exec(css);
|
|
1757
1876
|
if (!rule) return null;
|
|
1758
1877
|
const open = rule.index + rule[0].length - 1;
|
|
1759
1878
|
const close = css.indexOf("}", open);
|
|
@@ -1764,55 +1883,87 @@ function themeFileText(packageRoot) {
|
|
|
1764
1883
|
return [
|
|
1765
1884
|
`/* ${THEME_FILE} - the decisions every other token derives from, written by zyncat-ui init.`,
|
|
1766
1885
|
" Loaded after @zyncat/ui/styles.css, so a value here wins; whatever you delete keeps the default.",
|
|
1767
|
-
" A [data-
|
|
1768
|
-
"
|
|
1886
|
+
" A [data-polarity='dark'] block here extends the dark polarity, a [data-theme='<name>'] one adds a",
|
|
1887
|
+
' palette, and data-theme="default" on a subtree brings these back inside another palette.',
|
|
1888
|
+
" Docs: https://ui.zyncat.app/theming",
|
|
1889
|
+
` @zyncat-ui ${version2} - the version whose decisions this mirrors; \`npx zyncat-ui update\` refreshes it. */`,
|
|
1890
|
+
":root,",
|
|
1891
|
+
"[data-theme='default'] {",
|
|
1769
1892
|
body,
|
|
1770
1893
|
"}",
|
|
1771
1894
|
""
|
|
1772
1895
|
].join("\n");
|
|
1773
1896
|
}
|
|
1774
|
-
|
|
1897
|
+
var themePath = (cwd, entry) => {
|
|
1775
1898
|
const dir = entry ? dirname3(entry) : ".";
|
|
1776
1899
|
const rel = dir === "." ? THEME_FILE : `${dir}/${THEME_FILE}`;
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1900
|
+
return { rel, path: join3(cwd, rel) };
|
|
1901
|
+
};
|
|
1902
|
+
function wireTheme(cwd, packageRoot, pm, entry, version2) {
|
|
1903
|
+
const { rel, path } = themePath(cwd, entry);
|
|
1904
|
+
const css = shippedDecisionsCss(packageRoot);
|
|
1905
|
+
if (!css)
|
|
1781
1906
|
return {
|
|
1782
1907
|
line: row("Theme file", `skipped \xB7 ${PACKAGE} ships no ${THEME_SOURCE}`),
|
|
1783
1908
|
done: false,
|
|
1784
|
-
|
|
1909
|
+
hints: [`Upgrade it with ${ADD_COMMAND[pm]} ${PACKAGE}@latest, then re-run init.`]
|
|
1910
|
+
};
|
|
1911
|
+
if (existsSync3(path)) {
|
|
1912
|
+
const drift = themeDrift(readFileSync2(path, "utf8"), parseDecisions(css));
|
|
1913
|
+
const news = drift.added.length ? ` \xB7 ${drift.added.length} new decision${drift.added.length === 1 ? "" : "s"} available` : "";
|
|
1914
|
+
const hints = [];
|
|
1915
|
+
if (drift.added.length) hints.push(driftHint(drift, "npx zyncat-ui update"));
|
|
1916
|
+
if (drift.deprecated.length) hints.push(deprecatedNote(drift.deprecated));
|
|
1917
|
+
return {
|
|
1918
|
+
line: row("Theme file", `${rel} \xB7 kept${news}`),
|
|
1919
|
+
done: true,
|
|
1920
|
+
hints,
|
|
1921
|
+
warn: drift.removed.length ? removedWarning(drift.removed) : void 0
|
|
1922
|
+
};
|
|
1923
|
+
}
|
|
1924
|
+
const text = themeFileText(css, version2);
|
|
1925
|
+
if (!text)
|
|
1926
|
+
return {
|
|
1927
|
+
line: row("Theme file", `skipped \xB7 ${THEME_SOURCE} has no :root block`),
|
|
1928
|
+
done: false,
|
|
1929
|
+
hints: [`Upgrade it with ${ADD_COMMAND[pm]} ${PACKAGE}@latest, then re-run init.`]
|
|
1785
1930
|
};
|
|
1786
1931
|
writeFileSync(path, text);
|
|
1787
1932
|
return { line: row("Theme file", `${rel} \xB7 written`), done: true };
|
|
1788
1933
|
}
|
|
1789
|
-
|
|
1934
|
+
var STYLES_LINE = /^\s*import\s+(['"])@zyncat\/ui\/styles\.css\1;?\s*$/;
|
|
1935
|
+
var THEME_LINE = new RegExp(`^\\s*import\\s+(['"])[^'"]*${THEME_FILE.replace(/\./g, "\\.")}\\1;?\\s*$`);
|
|
1936
|
+
var CSS_LINE = /^\s*import\s+(['"])(\.[^'"]*\.css)\1;?\s*$/;
|
|
1937
|
+
var slashes = (path) => path.split(/[\\/]/).filter(Boolean).join("/");
|
|
1938
|
+
function importsStylesheet(line, fromDir, target) {
|
|
1939
|
+
const spec = CSS_LINE.exec(line)?.[2];
|
|
1940
|
+
return spec !== void 0 && slashes(join3(fromDir, spec)) === slashes(target);
|
|
1941
|
+
}
|
|
1942
|
+
function wireStyles(cwd, entry, tailwindEntry) {
|
|
1943
|
+
const below = tailwindEntry ? `below the ${tailwindEntry} import` : "above your own stylesheets";
|
|
1790
1944
|
if (!entry)
|
|
1791
1945
|
return {
|
|
1792
1946
|
line: row("Stylesheet", "no app entry found \xB7 add the imports yourself"),
|
|
1793
1947
|
done: false,
|
|
1794
|
-
|
|
1948
|
+
hints: [`Put ${STYLES_IMPORT} then ${THEME_IMPORT} at your app root, ${below}.`]
|
|
1795
1949
|
};
|
|
1796
1950
|
const path = join3(cwd, entry);
|
|
1797
1951
|
const text = readFileSync2(path, "utf8");
|
|
1798
1952
|
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
1799
|
-
const
|
|
1800
|
-
const
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}
|
|
1813
|
-
if (!added.length) return { line: row("Stylesheet", `${entry} \xB7 already imported`), done: true };
|
|
1814
|
-
writeFileSync(path, lines.join(eol));
|
|
1815
|
-
const what = added.length === 2 ? "imports added" : added[0] === "theme" ? "theme import added" : "import added";
|
|
1953
|
+
const dir = dirname3(entry);
|
|
1954
|
+
const hasTheme = existsSync3(join3(cwd, dir, THEME_FILE));
|
|
1955
|
+
const mine = (line) => STYLES_LINE.test(line) || hasTheme && THEME_LINE.test(line);
|
|
1956
|
+
const had = text.split(eol).some(mine);
|
|
1957
|
+
const kept = text.split(eol).filter((line) => !mine(line));
|
|
1958
|
+
const bridgeAt = tailwindEntry ? kept.findIndex((line) => importsStylesheet(line, dir, tailwindEntry)) : -1;
|
|
1959
|
+
let at = 0;
|
|
1960
|
+
if (bridgeAt !== -1) at = bridgeAt + 1;
|
|
1961
|
+
else while (at < kept.length && (kept[at].trim() === "" || /^(['"])use [\w-]+\1;?$/.test(kept[at].trim()))) at++;
|
|
1962
|
+
kept.splice(at, 0, STYLES_IMPORT, ...hasTheme ? [THEME_IMPORT] : []);
|
|
1963
|
+
const next = kept.join(eol);
|
|
1964
|
+
if (next === text) return { line: row("Stylesheet", `${entry} \xB7 already imported`), done: true };
|
|
1965
|
+
writeFileSync(path, next);
|
|
1966
|
+
const what = had && bridgeAt !== -1 ? `imports moved below ${tailwindEntry}` : had ? "imports updated" : "imports added";
|
|
1816
1967
|
return { line: row("Stylesheet", `${entry} \xB7 ${what}`), done: true };
|
|
1817
1968
|
}
|
|
1818
1969
|
function wireTailwind(cwd, targetPkg) {
|
|
@@ -1822,25 +1973,26 @@ function wireTailwind(cwd, targetPkg) {
|
|
|
1822
1973
|
return {
|
|
1823
1974
|
line: row("Tailwind", `skipped \xB7 Tailwind ${major} has no @theme`),
|
|
1824
1975
|
done: false,
|
|
1825
|
-
|
|
1976
|
+
hints: [`The bridge needs Tailwind v4 - ${DOCS_URL}/theming#tailwind.`]
|
|
1826
1977
|
};
|
|
1827
1978
|
const entry = findTailwindEntry(cwd);
|
|
1828
1979
|
if (!entry)
|
|
1829
1980
|
return {
|
|
1830
1981
|
line: row("Tailwind", "no stylesheet imports tailwindcss \xB7 add the line yourself"),
|
|
1831
1982
|
done: false,
|
|
1832
|
-
|
|
1983
|
+
hints: [`Put @import '${TAILWIND_BRIDGE}'; above @import 'tailwindcss'; in the stylesheet Tailwind compiles.`]
|
|
1833
1984
|
};
|
|
1834
1985
|
const path = join3(cwd, entry);
|
|
1835
1986
|
const text = readFileSync2(path, "utf8");
|
|
1836
|
-
if (text.includes(TAILWIND_BRIDGE))
|
|
1987
|
+
if (text.includes(TAILWIND_BRIDGE))
|
|
1988
|
+
return { line: row("Tailwind", `${entry} \xB7 already imported`), done: true, bridge: entry };
|
|
1837
1989
|
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
1838
1990
|
const lines = text.split(eol);
|
|
1839
1991
|
const at = lines.findIndex((line) => TAILWIND_IMPORT.test(line));
|
|
1840
1992
|
const quote = lines[at].includes('"') ? '"' : "'";
|
|
1841
1993
|
lines.splice(at, 0, `@import ${quote}${TAILWIND_BRIDGE}${quote};`);
|
|
1842
1994
|
writeFileSync(path, lines.join(eol));
|
|
1843
|
-
return { line: row("Tailwind", `${entry} \xB7 import added`), done: true };
|
|
1995
|
+
return { line: row("Tailwind", `${entry} \xB7 import added`), done: true, bridge: entry };
|
|
1844
1996
|
}
|
|
1845
1997
|
async function init(flags) {
|
|
1846
1998
|
const startedAt = performance.now();
|
|
@@ -1862,6 +2014,7 @@ async function init(flags) {
|
|
|
1862
2014
|
const pmVer = pmVersion(pm);
|
|
1863
2015
|
const project = targetPkg.name ?? "unnamed project";
|
|
1864
2016
|
log.message(dim(`${project} \xB7 ${pm}${pmVer ? ` ${pmVer}` : ""}`));
|
|
2017
|
+
const before = installedVersion(cwd, PACKAGE);
|
|
1865
2018
|
const plan = await planInstall(cwd, targetPkg, flags, version2);
|
|
1866
2019
|
const installed = await installPhase(pm, plan, cwd);
|
|
1867
2020
|
installTouchedProject = true;
|
|
@@ -1869,18 +2022,21 @@ async function init(flags) {
|
|
|
1869
2022
|
if (plan.reactNote) log.warn(plan.reactNote);
|
|
1870
2023
|
await alignVersion(pm, cwd, version2);
|
|
1871
2024
|
const packageRoot = sourceRoot(cwd, ownRoot);
|
|
2025
|
+
const landed = installedVersion(cwd, PACKAGE) ?? version2;
|
|
2026
|
+
if (before && isOlder(before, landed)) log.message(crossedVersions(before, landed), { symbol: check });
|
|
1872
2027
|
const entry = findAppEntry(cwd);
|
|
1873
2028
|
const tailwind = wireTailwind(cwd, targetPkg);
|
|
1874
2029
|
const rows = [
|
|
1875
2030
|
wireSkill(cwd, packageRoot, pm),
|
|
1876
2031
|
wireMcp(cwd),
|
|
1877
|
-
wireTheme(cwd, packageRoot, pm, entry),
|
|
1878
|
-
wireStyles(cwd, entry),
|
|
2032
|
+
wireTheme(cwd, packageRoot, pm, entry, landed),
|
|
2033
|
+
wireStyles(cwd, entry, tailwind?.bridge ?? null),
|
|
1879
2034
|
...tailwind ? [tailwind] : []
|
|
1880
2035
|
];
|
|
1881
2036
|
for (const [index, entry2] of rows.entries()) {
|
|
1882
2037
|
log.message(entry2.line, { symbol: entry2.done ? check : skip, spacing: index === 0 ? 1 : 0 });
|
|
1883
|
-
|
|
2038
|
+
for (const hint of entry2.hints ?? []) log.message(dim(hint), { spacing: 0 });
|
|
2039
|
+
if (entry2.warn) log.warn(entry2.warn);
|
|
1884
2040
|
}
|
|
1885
2041
|
log.message(`${dim("Docs")} ${arrow} ${accentDeep(DOCS_URL)}`);
|
|
1886
2042
|
const skipped = rows.filter((entry2) => !entry2.done).length;
|
|
@@ -1888,6 +2044,64 @@ async function init(flags) {
|
|
|
1888
2044
|
outro(closing);
|
|
1889
2045
|
}
|
|
1890
2046
|
|
|
2047
|
+
// src/update.ts
|
|
2048
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
2049
|
+
import { join as join4 } from "path";
|
|
2050
|
+
var PACKAGE2 = "@zyncat/ui";
|
|
2051
|
+
var DOCS_URL2 = "https://ui.zyncat.app";
|
|
2052
|
+
var interactive2 = () => Boolean(process.stdout.isTTY && process.stdin.isTTY);
|
|
2053
|
+
function stop(message, hint) {
|
|
2054
|
+
log.error(message);
|
|
2055
|
+
if (hint) log.message(dim(hint), { spacing: 0 });
|
|
2056
|
+
outro(red("Nothing was changed."));
|
|
2057
|
+
process.exit(1);
|
|
2058
|
+
}
|
|
2059
|
+
async function update(flags) {
|
|
2060
|
+
const { root: ownRoot, version: version2 } = findOwnRoot();
|
|
2061
|
+
const cwd = process.cwd();
|
|
2062
|
+
intro(wordmark(version2));
|
|
2063
|
+
const targetPkg = readJson(join4(cwd, "package.json"));
|
|
2064
|
+
if (!targetPkg) stop("No package.json here - update runs inside a React project that already ran init.");
|
|
2065
|
+
if (targetPkg.name === PACKAGE2 || targetPkg.name === "zyncat-ui")
|
|
2066
|
+
stop("This is the zyncat-ui repository - update runs in a consumer project.");
|
|
2067
|
+
const packageRoot = sourceRoot(cwd, ownRoot);
|
|
2068
|
+
const landed = installedVersion(cwd, PACKAGE2);
|
|
2069
|
+
if (!landed) stop(`${PACKAGE2} is not installed here.`, "Run npx zyncat-ui init first.");
|
|
2070
|
+
log.message(dim(`${targetPkg.name ?? "unnamed project"} \xB7 ${PACKAGE2} ${landed}`));
|
|
2071
|
+
const shipped = shippedDecisionsCss(packageRoot);
|
|
2072
|
+
if (!shipped) stop(`${PACKAGE2} ${landed} ships no decisions to compare against.`);
|
|
2073
|
+
const { rel, path } = themePath(cwd, findAppEntry(cwd));
|
|
2074
|
+
if (!existsSync4(path)) stop(`No ${rel} here.`, "Run npx zyncat-ui init to write one.");
|
|
2075
|
+
const current = readFileSync3(path, "utf8");
|
|
2076
|
+
const stamp = stampOf(current);
|
|
2077
|
+
const drift = themeDrift(current, parseDecisions(shipped));
|
|
2078
|
+
if (drift.deprecated.length) log.message(dim(deprecatedNote(drift.deprecated)), { spacing: 0 });
|
|
2079
|
+
if (drift.removed.length) log.warn(removedWarning(drift.removed));
|
|
2080
|
+
if (!drift.added.length) {
|
|
2081
|
+
if (stamp !== landed) writeFileSync2(path, withDecisions(current, [], landed));
|
|
2082
|
+
log.message(row("Theme file", `${rel} \xB7 every decision in ${landed} is already in your file`), { symbol: check });
|
|
2083
|
+
outro(bold(stamp === landed ? "Up to date." : `Up to date. Stamp ${stamp} ${arrow} ${landed}.`));
|
|
2084
|
+
return;
|
|
2085
|
+
}
|
|
2086
|
+
log.message(
|
|
2087
|
+
`${bold(`${drift.added.length} new decision${drift.added.length === 1 ? "" : "s"}`)} ${dim(`since ${stamp}`)}
|
|
2088
|
+
|
|
2089
|
+
${drift.added.map((decision) => renderDecision(decision, " ")).join("\n")}`
|
|
2090
|
+
);
|
|
2091
|
+
log.message(dim(driftHint(drift, "This")), { spacing: 0 });
|
|
2092
|
+
if (!flags.yes && interactive2()) {
|
|
2093
|
+
const answer = await confirm({ message: `Add ${drift.added.length === 1 ? "it" : "them"} to ${rel}?` });
|
|
2094
|
+
if (isCancel(answer) || !answer) {
|
|
2095
|
+
cancel("Cancelled - nothing was changed.");
|
|
2096
|
+
process.exit(isCancel(answer) ? 130 : 0);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
writeFileSync2(path, withDecisions(current, drift.added, landed));
|
|
2100
|
+
log.message(row("Theme file", `${rel} \xB7 ${drift.added.length} added, stamped ${landed}`), { symbol: check });
|
|
2101
|
+
log.message(`${dim("Docs")} ${arrow} ${accentDeep(`${DOCS_URL2}/theming`)}`);
|
|
2102
|
+
outro(bold("Your values were not touched."));
|
|
2103
|
+
}
|
|
2104
|
+
|
|
1891
2105
|
// src/cli.ts
|
|
1892
2106
|
function parseFlags(args) {
|
|
1893
2107
|
const flags = { yes: false };
|
|
@@ -1912,11 +2126,12 @@ function help(version2) {
|
|
|
1912
2126
|
` ${dim("and, under Tailwind v4, the utility bridge.")}`,
|
|
1913
2127
|
"",
|
|
1914
2128
|
` ${bold("Usage")}`,
|
|
1915
|
-
` zyncat-ui init ${dim("[flags]")}`,
|
|
2129
|
+
` zyncat-ui init ${dim("[flags]")} ${dim("set the project up, or re-wire it after an upgrade")}`,
|
|
2130
|
+
` zyncat-ui update ${dim("[flags]")} ${dim("add decisions the library gained since your theme file")}`,
|
|
1916
2131
|
"",
|
|
1917
2132
|
` ${bold("Flags")}`,
|
|
1918
2133
|
` --yes, -y ${dim("accept every default, never prompt")}`,
|
|
1919
|
-
` --pm <name> ${dim(`force the package manager (${PACKAGE_MANAGERS.join(", ")})`)}`,
|
|
2134
|
+
` --pm <name> ${dim(`force the package manager (${PACKAGE_MANAGERS.join(", ")}) - init only`)}`,
|
|
1920
2135
|
"",
|
|
1921
2136
|
` ${dim("Docs")} ${arrow} ${accentDeep("https://ui.zyncat.app")}`,
|
|
1922
2137
|
""
|
|
@@ -1927,13 +2142,14 @@ var [command, ...rest] = process.argv.slice(2);
|
|
|
1927
2142
|
var { version } = findOwnRoot();
|
|
1928
2143
|
if (command === "--version" || command === "-v") {
|
|
1929
2144
|
console.log(version);
|
|
1930
|
-
} else if (command === "init") {
|
|
2145
|
+
} else if (command === "init" || command === "update") {
|
|
1931
2146
|
const flags = parseFlags(rest);
|
|
1932
2147
|
if (!flags) {
|
|
1933
2148
|
console.error(help(version));
|
|
1934
2149
|
process.exit(1);
|
|
1935
2150
|
}
|
|
1936
|
-
await init(flags);
|
|
2151
|
+
if (command === "init") await init(flags);
|
|
2152
|
+
else await update({ yes: flags.yes });
|
|
1937
2153
|
} else {
|
|
1938
2154
|
console.log(help(version));
|
|
1939
2155
|
process.exit(command ? 1 : 0);
|
package/dist/collapse.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@layer zyncat.tokens, zyncat.components;
|
|
1
|
+
@layer zyncat.reset, zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
/* Registered non-inheriting so a Collapse's inline timing never leaks into a Collapse nested
|
|
4
4
|
inside it; unset, they resolve invalid and the var() fallbacks supply the defaults. */
|
|
@@ -35,8 +35,7 @@
|
|
|
35
35
|
.zc-collapse[data-open='false'] {
|
|
36
36
|
visibility: hidden;
|
|
37
37
|
}
|
|
38
|
-
/* No visibility: visible here -
|
|
39
|
-
nested under a closed ancestor hidden. */
|
|
38
|
+
/* No visibility: visible here - inheriting it would reveal a Collapse nested under a closed one. */
|
|
40
39
|
.zc-collapse[data-open='true'] {
|
|
41
40
|
grid-template-rows: 1fr;
|
|
42
41
|
transition:
|
|
@@ -53,12 +52,16 @@
|
|
|
53
52
|
grid-template-columns: 1fr;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
/* min-size:0 is what lets the grid track collapse to 0. */
|
|
57
55
|
.zc-collapse__inner {
|
|
58
|
-
overflow:
|
|
56
|
+
overflow-x: visible;
|
|
57
|
+
overflow-y: clip;
|
|
59
58
|
min-height: 0;
|
|
60
59
|
min-width: 0;
|
|
61
60
|
}
|
|
61
|
+
.zc-collapse[data-axis='width'] .zc-collapse__inner {
|
|
62
|
+
overflow-x: clip;
|
|
63
|
+
overflow-y: visible;
|
|
64
|
+
}
|
|
62
65
|
|
|
63
66
|
.zc-collapse--fade .zc-collapse__inner {
|
|
64
67
|
opacity: 0;
|
package/dist/confetti.css
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
@layer zyncat.tokens, zyncat.components;
|
|
1
|
+
@layer zyncat.reset, zyncat.tokens, zyncat.components;
|
|
2
2
|
|
|
3
3
|
@layer zyncat.components {
|
|
4
4
|
.zc-confetti {
|
|
5
|
-
/* The five papers a burst draws from
|
|
5
|
+
/* The five papers a burst draws from. */
|
|
6
6
|
--confetti-paper-1: oklch(0.53 0.2 288);
|
|
7
7
|
--confetti-paper-2: var(--accent);
|
|
8
8
|
--confetti-paper-3: oklch(0.78 0.115 62);
|
|
9
9
|
--confetti-paper-4: oklch(0.67 0.18 12);
|
|
10
10
|
--confetti-paper-5: var(--text-strong);
|
|
11
|
-
/* How often each paper appears
|
|
11
|
+
/* How often each paper appears, in slot order. */
|
|
12
12
|
--confetti-weights: 1 1 1 1 0.45;
|
|
13
13
|
|
|
14
14
|
/* What the reverse side of a piece darkens toward. */
|
package/dist/confetti.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
'use client';import { loop } from './chunk-
|
|
1
|
+
'use client';import { loop } from './chunk-HWDIVGME.js';
|
|
2
2
|
import './chunk-VNVVG47J.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-ZHMOH62S.js';
|
|
4
4
|
import { cx } from './chunk-QGNC7LH5.js';
|
|
5
5
|
import './confetti.css';
|
|
6
6
|
import { useRef, useSyncExternalStore, useEffect, useImperativeHandle } from 'react';
|
package/dist/date-field.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
'use client';import { DtpPanel } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
'use client';import { DtpPanel } from './chunk-7VTWJL72.js';
|
|
2
|
+
import './chunk-WQKWPI6V.js';
|
|
3
|
+
import { Popover } from './chunk-M2A6PZ7J.js';
|
|
4
|
+
import { FieldTrigger, displayDay, FieldShell } from './chunk-VZXML7EH.js';
|
|
5
5
|
import './chunk-IUQAUBVM.js';
|
|
6
6
|
import './chunk-UE63OOVG.js';
|
|
7
7
|
import './chunk-5W5TKANX.js';
|
|
8
8
|
import './chunk-WZUTBJC4.js';
|
|
9
9
|
import './chunk-LNAV5E7S.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-3MLUH2QL.js';
|
|
11
11
|
import './chunk-HDSFWZ7L.js';
|
|
12
|
-
import './chunk-
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
12
|
+
import './chunk-RY35IU3G.js';
|
|
13
|
+
import './chunk-DH7DT6EO.js';
|
|
14
|
+
import './chunk-FLDIRXFU.js';
|
|
15
|
+
import './chunk-GWCBTD63.js';
|
|
16
|
+
import './chunk-HWDIVGME.js';
|
|
17
17
|
import './chunk-VNVVG47J.js';
|
|
18
|
-
import './chunk-GJTHWB6O.js';
|
|
19
|
-
import './chunk-GOLSYGRA.js';
|
|
20
18
|
import { useControllable } from './chunk-MMRIQNEN.js';
|
|
21
|
-
import './chunk-
|
|
22
|
-
import './chunk-
|
|
19
|
+
import './chunk-QDAN43B6.js';
|
|
20
|
+
import './chunk-TBLPZQSI.js';
|
|
21
|
+
import './chunk-ZHMOH62S.js';
|
|
22
|
+
import './chunk-LH2UIEKN.js';
|
|
23
|
+
import './chunk-KSAJ6DED.js';
|
|
24
|
+
import './chunk-NYQQH4R5.js';
|
|
23
25
|
import './chunk-5VC3TUZ2.js';
|
|
24
26
|
import './chunk-DMX2F6B4.js';
|
|
25
27
|
import './chunk-QGNC7LH5.js';
|
package/dist/date-field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/composites/date-picker/DateField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/composites/date-picker/DateField.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,SAAS,SAAA,CAAU;AAAA,EACxB,KAAA;AAAA,EACA,YAAA,GAAe,IAAA;AAAA,EACf,QAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA,GAAc,aAAA;AAAA,EACd,QAAA;AAAA,EACA,GAAA;AAAA,EACA,GAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,OAAA,GAAU,KAAA;AAAA,EACV,OAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,SAAA,GAAY,EAAA;AAAA,EACZ,SAAA;AAAA,EACA,UAAA,GAAa,aAAA;AAAA,EACb;AACF,CAAA,EAAmB;AACjB,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,IAAI,eAAA,CAAgB,KAAA,EAAO,cAAc,QAAQ,CAAA;AACnE,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AAClD,EAAA,MAAM,OAAA,uBAAW,YAAA,EAAA,EAAa,OAAA,EAAS,WAAW,GAAG,CAAA,EAAG,aAA0B,QAAA,EAAoB,CAAA;AAEtG,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,QAAA;AAAA,MACR,KAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,MACA,OAAA;AAAA,MACA,IAAA,EAAK,UAAA;AAAA,MACL,SAAA;AAAA,MACA,SAAA;AAAA,MAEA,QAAA,kBAAA,GAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,IAAA,EAAK,QAAA;AAAA,UACL,KAAA,EAAM,OAAA;AAAA,UACN,UAAA;AAAA,UACA,SAAA;AAAA,UACA,IAAA,EAAM,UAAA;AAAA,UACN,YAAA,EAAc,aAAA;AAAA,UAEd,QAAA,kBAAA,GAAA;AAAA,YAAC,QAAA;AAAA,YAAA;AAAA,cACC,GAAA;AAAA,cACA,MAAA;AAAA,cACA,KAAA,EAAO,MAAM,aAAA,CAAc,KAAK,CAAA;AAAA,cAChC,GAAA;AAAA,cACA,GAAA;AAAA,cACA,QAAA;AAAA,cACA,KAAA;AAAA,cACA;AAAA;AAAA;AACF;AAAA;AACF;AAAA,GACF;AAEJ","file":"date-field.js","sourcesContent":["'use client';\n\nimport './date-picker.css';\n\nimport { useState } from 'react';\n\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { Popover } from '../popover/Popover';\nimport { DtpPanel } from './calendar-panel';\nimport { displayDay } from './date-utils';\nimport { FieldShell, FieldTrigger, type DateFieldBaseProps } from './field-shell';\n\nexport interface DateFieldProps extends DateFieldBaseProps {\n /** Controlled value, 'YYYY-MM-DD'. */\n value?: string | null;\n /** Uncontrolled initial value, 'YYYY-MM-DD'. Use instead of `value`. @default null */\n defaultValue?: string | null;\n /** Fires on each day pick (commit is live), with the picked 'YYYY-MM-DD'. */\n onChange?: (value: string) => void;\n /** Trigger text shown when no date is picked. @default 'Pick a date' */\n placeholder?: string;\n /** IANA timezone name (e.g. 'Europe/Riga') - display context only, shown with its GMT offset in the footer. */\n timezone?: string;\n /** Earliest pickable date, 'YYYY-MM-DD', inclusive. */\n min?: string;\n /** Latest pickable date, 'YYYY-MM-DD', inclusive. */\n max?: string;\n}\n\nexport function DateField({\n value,\n defaultValue = null,\n onChange,\n label,\n placeholder = 'Pick a date',\n timezone,\n min,\n max,\n required = false,\n invalid = false,\n message,\n disabled = false,\n className = '',\n htmlProps,\n activateOn = 'pointerdown',\n animation,\n}: DateFieldProps) {\n const [val, commit] = useControllable(value, defaultValue, onChange);\n const [pickerOpen, setPickerOpen] = useState(false);\n const trigger = <FieldTrigger display={displayDay(val)} placeholder={placeholder} disabled={disabled} />;\n\n return (\n <FieldShell\n variant=\"zc-dtf\"\n label={label}\n required={required}\n invalid={invalid}\n message={message}\n icon=\"calendar\"\n className={className}\n htmlProps={htmlProps}\n >\n <Popover\n trigger={trigger}\n side=\"bottom\"\n align=\"start\"\n activateOn={activateOn}\n animation={animation}\n open={pickerOpen}\n onOpenChange={setPickerOpen}\n >\n <DtpPanel\n val={val}\n commit={commit}\n close={() => setPickerOpen(false)}\n min={min}\n max={max}\n timezone={timezone}\n label={label}\n activateOn={activateOn}\n />\n </Popover>\n </FieldShell>\n );\n}\n"]}
|