diff --git a/index.html b/index.html index af60023f..daa81759 100644 --- a/index.html +++ b/index.html @@ -12,6 +12,13 @@ content="Charizard — the ZenAdmin design system. Live demos, copy-paste snippets and agent-readable docs for every React component." /> Charizard UI | ZenAdmin Design System + + + +
diff --git a/package.json b/package.json index 168385b8..2e14860c 100644 --- a/package.json +++ b/package.json @@ -95,8 +95,6 @@ }, "packageManager": "pnpm@12.15.0", "dependencies": { - "@fontsource-variable/geist": "^5.3.0", - "@fontsource-variable/geist-mono": "^5.3.0", "@hybr1d-tech/groudon": "^1.0.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a4d0ea3..b707a93a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -192,12 +192,6 @@ importers: '@dnd-kit/react': specifier: ^0.5.1 version: 0.5.1(react-dom@19.3.1(react@19.3.1))(react@19.3.1) - '@fontsource-variable/geist': - specifier: ^5.3.0 - version: 5.3.0 - '@fontsource-variable/geist-mono': - specifier: ^5.3.0 - version: 5.3.0 '@hybr1d-tech/groudon': specifier: ^1.0.0 version: 1.0.0 @@ -699,12 +693,6 @@ packages: '@floating-ui/utils@0.2.9': resolution: {integrity: sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==} - '@fontsource-variable/geist-mono@5.3.0': - resolution: {integrity: sha512-vBbuwDEo9AkrqADMXOrlAR3DFcJi4/JxeuU43FoiQERnNwsfXNnvxvReZG02cQKmyk4DZkZdBZX3oTDvy2zBAw==} - - '@fontsource-variable/geist@5.3.0': - resolution: {integrity: sha512-j0m+vLQuG5XAYoHtGCVu0spvlGreR3EzpECUVzkFmI1mTVnAO38l/NEPDCFgZ177JxzYJCLSmTQibIiYPilGrA==} - '@hybr1d-tech/groudon@1.0.0': resolution: {integrity: sha512-xPdquf3qfyQaVix9Qan13kTa2CECDGjR2t7UmGTBxWjbYHUd7XpbbM5hBbpod4E3kBNzGAg0bw1C6+I7pOguyw==} engines: {node: '>=24'} @@ -3009,10 +2997,6 @@ snapshots: '@floating-ui/utils@0.2.9': {} - '@fontsource-variable/geist-mono@5.3.0': {} - - '@fontsource-variable/geist@5.3.0': {} - '@hybr1d-tech/groudon@1.0.0': {} '@jridgewell/gen-mapping@0.3.13': diff --git a/src/components/date-picker/date-picker.module.css b/src/components/date-picker/date-picker.module.css index 4cdf7b09..5cdd252c 100644 --- a/src/components/date-picker/date-picker.module.css +++ b/src/components/date-picker/date-picker.module.css @@ -1,6 +1,6 @@ .datePicker { display: grid; - gap: 0.5rem; + gap: calc(6 * var(--zap-px)); } .formButton { font-weight: 400 !important; @@ -80,13 +80,13 @@ } /* .nav { display: flex; - gap: 1rem; + gap: calc(13 * var(--zap-px)); align-items: center; } */ .navButtonNext, .navButtonPrevious { - height: 1.75rem; - width: 1.75rem; + height: calc(23 * var(--zap-px)); + width: calc(23 * var(--zap-px)); background-color: transparent; padding: 0; opacity: 0.5; @@ -109,10 +109,10 @@ background-color: var(--neutral-arch-20); } */ .navButtonPrevious { - left: 1rem; + left: calc(13 * var(--zap-px)); } .navButtonNext { - right: 1rem; + right: calc(13 * var(--zap-px)); } .table { width: 100%; @@ -123,10 +123,10 @@ display: flex; } .headCell { - font-size: 1rem; + font-size: calc(13 * var(--zap-px)); color: var(--text-hint); border-radius: 8px; - width: 2.25rem; + width: calc(29 * var(--zap-px)); font-weight: 400; width: 36px; display: flex; @@ -136,12 +136,12 @@ .row { display: flex; width: 100%; - margin-top: 0.5rem; + margin-top: calc(6 * var(--zap-px)); border-bottom: none !important; } .cell { text-align: center; - font-size: 0.8rem; + font-size: calc(10 * var(--zap-px)); padding: 0; position: relative; width: 36px; @@ -163,7 +163,7 @@ display: inline-flex; align-items: center; justify-content: center; - border-radius: 0.5rem; + border-radius: calc(6 * var(--zap-px)); border: none; outline: none; background-color: transparent; diff --git a/src/components/date-picker/date-range-picker.module.css b/src/components/date-picker/date-range-picker.module.css index 82c41201..449066b0 100644 --- a/src/components/date-picker/date-range-picker.module.css +++ b/src/components/date-picker/date-range-picker.module.css @@ -1,6 +1,6 @@ .dateRangePicker { display: grid; - gap: 0.5rem; + gap: calc(6 * var(--zap-px)); } .dateIcon > path, .dateIcon > g > path { @@ -39,7 +39,7 @@ } .months { display: flex; - gap: 1rem; + gap: calc(13 * var(--zap-px)); } .month { display: flex; @@ -50,7 +50,7 @@ display: flex; justify-content: center; align-items: center; - padding-top: 1rem; + padding-top: calc(13 * var(--zap-px)); position: relative; } .captionLabel { @@ -64,8 +64,8 @@ } .navButtonPrevious, .navButtonNext { - height: 1.75rem; - width: 1.75rem; + height: calc(23 * var(--zap-px)); + width: calc(23 * var(--zap-px)); background-color: transparent; padding: 0; opacity: 0.5; @@ -86,10 +86,10 @@ } .navButtonPrevious { - left: 1rem; + left: calc(13 * var(--zap-px)); } .navButtonNext { - right: 1rem; + right: calc(13 * var(--zap-px)); } .table { width: 100%; @@ -100,7 +100,7 @@ display: flex; } .headCell { - font-size: 1rem; + font-size: calc(13 * var(--zap-px)); color: var(--text-hint); border-radius: 8px; font-weight: 400; @@ -112,12 +112,12 @@ .row { display: flex; width: 100%; - margin-top: 0.5rem; + margin-top: calc(6 * var(--zap-px)); border-bottom: none !important; } .cell { text-align: center; - font-size: 0.8rem; + font-size: calc(10 * var(--zap-px)); padding: 0; position: relative; width: 36px; @@ -138,7 +138,7 @@ display: inline-flex; align-items: center; justify-content: center; - border-radius: 0.5rem; + border-radius: calc(6 * var(--zap-px)); border: none; outline: none; background-color: transparent; @@ -158,7 +158,7 @@ } .daySelected { background-color: var(--theme-blue-dark); - border-radius: 0.5rem; + border-radius: calc(6 * var(--zap-px)); } .daySelected:not(.dayRangeMiddle) .day { @@ -170,7 +170,7 @@ color: var(--neutral-white); } .dayToday { - border-radius: 0.5rem; + border-radius: calc(6 * var(--zap-px)); background-color: var(--neutral-arch-40); color: var(--text-primary); } @@ -204,7 +204,7 @@ border-bottom-left-radius: 0; } .dayRangeStart.dayRangeEnd { - border-radius: 0.5rem; + border-radius: calc(6 * var(--zap-px)); } .dayRangeMiddle { background-color: var(--neutral-arch-20); diff --git a/src/components/drawer/Drawer.tsx b/src/components/drawer/Drawer.tsx index 12e8ae2a..62c0dd8b 100644 --- a/src/components/drawer/Drawer.tsx +++ b/src/components/drawer/Drawer.tsx @@ -110,7 +110,7 @@ export function Drawer({ const timeout = setTimeout(() => { if (containerRef.current && descriptionRef.current && footerRef.current) { const translateXValue = isOpen ? 'translateX(0)' : `translateX(${translateXOffset})` - const descriptionHeight = `calc(100dvh - (1.75rem * 2) - ${footerRef.current.clientHeight}px)` + const descriptionHeight = `calc(100dvh - 46 * var(--zap-px) - ${footerRef.current.clientHeight}px)` containerRef.current.style.transform = translateXValue descriptionRef.current.style.maxHeight = descriptionHeight diff --git a/src/components/drawer/styles.module.css b/src/components/drawer/styles.module.css index 7a646dc9..464a0f62 100644 --- a/src/components/drawer/styles.module.css +++ b/src/components/drawer/styles.module.css @@ -46,23 +46,23 @@ } .container.sm { - width: 30.8rem; + width: calc(400 * var(--zap-px)); } .container.md { - width: 46.2rem; + width: calc(600 * var(--zap-px)); } .container.lg { - width: 63.08rem; + width: calc(820 * var(--zap-px)); } .container.xlg { - width: 77rem; + width: calc(1000 * var(--zap-px)); } .container.xxlg { - width: 92.3rem; + width: calc(1200 * var(--zap-px)); } .content { @@ -86,8 +86,8 @@ .title { font-style: normal; font-weight: 500; - font-size: 1.54rem; - line-height: 2.15rem; + font-size: calc(20 * var(--zap-px)); + line-height: calc(28 * var(--zap-px)); color: var(--text-primary); } @@ -112,8 +112,8 @@ .descriptionContainer { padding: 20px; - max-height: calc(100dvh - (1.75rem * 2)); - height: calc(100dvh - (1.75rem * 2)); + max-height: calc(100dvh - 46 * var(--zap-px)); + height: calc(100dvh - 46 * var(--zap-px)); overflow: scroll; } .descriptionContainer.fullHeight { @@ -154,8 +154,8 @@ .saveBtn, .cancelBtn { font-weight: 400; - font-size: 1.23rem; - line-height: 1.9rem; + font-size: calc(16 * var(--zap-px)); + line-height: calc(25 * var(--zap-px)); padding: 8px 16px; border-radius: 6px; } diff --git a/src/components/empty-state/styles.module.css b/src/components/empty-state/styles.module.css index 259cdfc8..e4528b13 100644 --- a/src/components/empty-state/styles.module.css +++ b/src/components/empty-state/styles.module.css @@ -10,7 +10,7 @@ .containerRow { flex-direction: row; - gap: 1.62rem; + gap: calc(21 * var(--zap-px)); } .title { diff --git a/src/components/input/styles.module.css b/src/components/input/styles.module.css index a827b780..93beb2a9 100644 --- a/src/components/input/styles.module.css +++ b/src/components/input/styles.module.css @@ -7,11 +7,11 @@ } .inputContainer.sm { - width: 20.8rem; + width: calc(270 * var(--zap-px)); } .inputContainer.md { - width: 27.7rem; + width: calc(360 * var(--zap-px)); } .inputLabelContainer { @@ -58,8 +58,8 @@ .input, .textarea { font-weight: 400; - font-size: 1.23rem; - line-height: 1.85rem; + font-size: calc(16 * var(--zap-px)); + line-height: calc(24 * var(--zap-px)); color: var(--text-primary); width: 100%; @@ -73,7 +73,7 @@ } .input { - height: 2.8rem; + height: calc(36 * var(--zap-px)); } .input::placeholder, @@ -105,8 +105,8 @@ input[type='date']::-webkit-inner-spin-button, .errorMsg { font-weight: 400; - font-size: 1rem; - line-height: 1.54rem; + font-size: calc(13 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: var(--status-danger); margin: 0; text-align: left; @@ -115,8 +115,8 @@ input[type='date']::-webkit-inner-spin-button, .inputElement { position: absolute; top: 0; - width: 2.8rem; - height: 2.8rem; + width: calc(36 * var(--zap-px)); + height: calc(36 * var(--zap-px)); display: flex; align-items: center; justify-content: center; @@ -133,7 +133,7 @@ input[type='date']::-webkit-inner-spin-button, .inputAddon { width: auto; - height: 2.8rem; + height: calc(36 * var(--zap-px)); display: flex; align-items: center; justify-content: center; @@ -169,9 +169,9 @@ input[type='date']::-webkit-inner-spin-button, border-radius: 8px; box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.15); padding: 0 0 12px 0; - max-height: 15rem; + max-height: calc(195 * var(--zap-px)); overflow-y: auto; - min-width: 15rem; + min-width: calc(195 * var(--zap-px)); z-index: 10; } diff --git a/src/components/layout-tabs/layout-tabs.module.css b/src/components/layout-tabs/layout-tabs.module.css index 3eeccdae..a455f870 100644 --- a/src/components/layout-tabs/layout-tabs.module.css +++ b/src/components/layout-tabs/layout-tabs.module.css @@ -35,8 +35,8 @@ -webkit-appearance: none; font-weight: 400; - font-size: 1.08rem; - line-height: 1.54rem; + font-size: calc(14 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: var(--text-secondary); height: 100%; border-bottom: 2px solid transparent; diff --git a/src/components/modal/styles.module.css b/src/components/modal/styles.module.css index 989274f2..4f0c9d60 100644 --- a/src/components/modal/styles.module.css +++ b/src/components/modal/styles.module.css @@ -30,7 +30,7 @@ .contentWrapper { width: 100%; /* took a random number of 1.75, might have to change it later according to preferences */ - /* max-height: calc(100dvh - (1.75rem * 2)); */ + /* max-height: calc(100dvh - 46 * var(--zap-px)); */ background-color: var(--neutral-white); /* overflow-x: hidden; */ border-radius: 8px; diff --git a/src/components/popover/styles.module.css b/src/components/popover/styles.module.css index 7dedf544..ea02a92b 100644 --- a/src/components/popover/styles.module.css +++ b/src/components/popover/styles.module.css @@ -22,7 +22,7 @@ position: absolute; top: 0; right: 0; - padding: 0.5rem; + padding: calc(6 * var(--zap-px)); } .arrow { diff --git a/src/components/progress/styles.module.css b/src/components/progress/styles.module.css index 77be9e90..07bd96d3 100644 --- a/src/components/progress/styles.module.css +++ b/src/components/progress/styles.module.css @@ -44,7 +44,7 @@ } .line { - width: 2.8rem; + width: calc(36 * var(--zap-px)); height: 1px; background: var(--neutral-arch-500); } diff --git a/src/components/select/styles.module.css b/src/components/select/styles.module.css index 9365591c..69464087 100644 --- a/src/components/select/styles.module.css +++ b/src/components/select/styles.module.css @@ -5,8 +5,8 @@ .selectContainer .errorMsg { font-weight: 400; - font-size: 1rem; - line-height: 1.54rem; + font-size: calc(13 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: #de350b; margin: 0; text-align: left; @@ -42,8 +42,8 @@ .optionContainer .subLabel { font-weight: 400; - font-size: 0.92rem; - line-height: 1.54rem; + font-size: calc(12 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: var(--text-secondary); } diff --git a/src/components/styles/charizard.css b/src/components/styles/charizard.css index e9402eac..ace2fe90 100644 --- a/src/components/styles/charizard.css +++ b/src/components/styles/charizard.css @@ -1,8 +1,6 @@ /* Global library styles, aggregated so the build injects them as ONE css import on the entry chunk with a deterministic cascade order. (Separate JS imports get injected in unspecified order by libInjectCss.) */ -@import '@fontsource-variable/geist'; -@import '@fontsource-variable/geist-mono'; /* the type scale (tokens + zap-* classes) comes from groudon, the shared typography package */ @import '@hybr1d-tech/groudon'; @import './_variables.css'; diff --git a/src/components/styles/global.css b/src/components/styles/global.css index 0e1f50d2..a227689e 100644 --- a/src/components/styles/global.css +++ b/src/components/styles/global.css @@ -1,6 +1,7 @@ :root { - --font-sans: 'Geist Variable', sans-serif; - --font-mono: 'Geist Mono Variable', monospace; + /* the product font is groudon's Instrument Sans, in the apps and on the showcase site alike */ + --font-sans: var(--zap-font-sans); + --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-family: var(--font-sans); font-synthesis: none; text-rendering: optimizeLegibility; @@ -112,8 +113,8 @@ h6 { .zap-error-msg { font-weight: 400; - font-size: 1rem; - line-height: 1.54rem; + font-size: calc(13 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: var(--status-danger); margin: 0; text-align: left; diff --git a/src/components/switch/styles.module.css b/src/components/switch/styles.module.css index 44369dcc..ea8a59da 100644 --- a/src/components/switch/styles.module.css +++ b/src/components/switch/styles.module.css @@ -5,15 +5,15 @@ } .switchLabel { - font-size: 1.08rem; - line-height: 1.54rem; + font-size: calc(14 * var(--zap-px)); + line-height: calc(20 * var(--zap-px)); color: var(--text-primary); } .subText { - font-size: 0.923rem; - line-height: 1.385rem; - margin-top: 0.75rem; + font-size: calc(12 * var(--zap-px)); + line-height: calc(18 * var(--zap-px)); + margin-top: calc(10 * var(--zap-px)); color: var(--text-secondary); } @@ -23,37 +23,37 @@ display: inline-block; } .switch.sm { - width: 2rem; - height: 1.231rem; + width: calc(26 * var(--zap-px)); + height: calc(16 * var(--zap-px)); } .switch.sm input:checked + .slider::before { - transform: translateX(0.769rem); + transform: translateX(calc(10 * var(--zap-px))); } .switch.sm .slider::before { - width: 0.923rem; - height: 0.923rem; + width: calc(12 * var(--zap-px)); + height: calc(12 * var(--zap-px)); } .switch.md { - width: 2.615rem; - height: 1.538rem; + width: calc(34 * var(--zap-px)); + height: calc(20 * var(--zap-px)); } .switch.md input:checked + .slider::before { - transform: translateX(1.077rem); + transform: translateX(calc(14 * var(--zap-px))); } .switch.md .slider::before { - height: 1.231rem; - width: 1.231rem; + height: calc(16 * var(--zap-px)); + width: calc(16 * var(--zap-px)); } .switch.lg { - width: 3.846rem; - height: 2.154rem; + width: calc(50 * var(--zap-px)); + height: calc(28 * var(--zap-px)); } .switch.lg input:checked + .slider::before { - transform: translateX(1.692rem); + transform: translateX(calc(22 * var(--zap-px))); } .switch.lg .slider::before { - width: 1.846rem; - height: 1.846rem; + width: calc(24 * var(--zap-px)); + height: calc(24 * var(--zap-px)); } .switch input { opacity: 0; @@ -88,9 +88,9 @@ .switch .slider::before { position: absolute; content: ''; - left: 0.154rem; - bottom: 0.154rem; - top: 0.154rem; + left: calc(2 * var(--zap-px)); + bottom: calc(2 * var(--zap-px)); + top: calc(2 * var(--zap-px)); background-color: white; border-radius: 50%; transition: 0.25s; diff --git a/src/components/table/table-pagination/table-pagination.module.css b/src/components/table/table-pagination/table-pagination.module.css index 29e7a1b3..8d22cf54 100644 --- a/src/components/table/table-pagination/table-pagination.module.css +++ b/src/components/table/table-pagination/table-pagination.module.css @@ -34,7 +34,7 @@ } .meta { - font-size: 0.85rem; + font-size: calc(11 * var(--zap-px)); } } diff --git a/src/components/toasts/styles/toast.css b/src/components/toasts/styles/toast.css index c8dc1164..cf6a73b2 100644 --- a/src/components/toasts/styles/toast.css +++ b/src/components/toasts/styles/toast.css @@ -4,7 +4,7 @@ touch-action: none; /* min-height: var(--toastify-toast-min-height); */ box-sizing: border-box; - margin-bottom: 1rem !important; + margin-bottom: calc(13 * var(--zap-px)) !important; padding: 8px; border-radius: 8px; box-shadow: 0px 4px 16px 0px rgba(18, 18, 18, 0.04), 0px 2px 8px 0px rgba(18, 18, 18, 0.08); diff --git a/src/components/upload/styles.module.css b/src/components/upload/styles.module.css index bf202c4f..56819e9b 100644 --- a/src/components/upload/styles.module.css +++ b/src/components/upload/styles.module.css @@ -4,7 +4,7 @@ border-radius: 4px; border: 1px dashed var(--p-p10); background: var(--fill-highlight, #fbfbfe); - padding: 16px 0.8rem; + padding: 16px calc(10 * var(--zap-px)); color: var(--text-secondary); } .uploadBtn:hover {