@jack.winter/pancake-ui 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +93 -2
- package/dist/components/Button/Button.d.ts +7 -0
- package/dist/components/Button/ButtonLink.d.ts +8 -0
- package/dist/components/Button/IconButton.d.ts +7 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Dialog/Dialog.d.ts +9 -0
- package/dist/components/Disclosure/Disclosure.d.ts +17 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +25 -0
- package/dist/components/DropdownMenu/menuKeyboard.d.ts +3 -0
- package/dist/components/FileField/FileField.d.ts +7 -0
- package/dist/components/Pagination/Pagination.d.ts +22 -0
- package/dist/components/Pagination/paginationPages.d.ts +5 -0
- package/dist/components/Popover/Popover.d.ts +7 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +18 -0
- package/dist/components/Select/Select.d.ts +9 -0
- package/dist/components/Surface/Surface.d.ts +3 -0
- package/dist/components/Switch/Switch.d.ts +6 -0
- package/dist/components/Table/Table.d.ts +6 -0
- package/dist/components/Tabs/Tabs.d.ts +17 -0
- package/dist/components/TextField/TextField.d.ts +8 -0
- package/dist/components/Textarea/Textarea.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip/useTooltip.d.ts +12 -0
- package/dist/components/feedback/BannerToast.d.ts +8 -0
- package/dist/components/feedback/EmptyState.d.ts +8 -0
- package/dist/components/feedback/StatusChip.d.ts +6 -0
- package/dist/components/identity/Avatar.d.ts +9 -0
- package/dist/components/identity/AvatarGroup.d.ts +13 -0
- package/dist/components/layout/Inline.d.ts +5 -0
- package/dist/components/layout/Stack.d.ts +10 -0
- package/dist/components/layout/Text.d.ts +8 -0
- package/dist/components/layout/layout.shared.d.ts +16 -0
- package/dist/components/navigation/AppHeader.d.ts +11 -0
- package/dist/components/navigation/BottomNavigation.d.ts +12 -0
- package/dist/components/navigation/SectionHeader.d.ts +11 -0
- package/dist/components/navigation/SegmentedControl.d.ts +15 -0
- package/dist/components/navigation/StepProgress.d.ts +6 -0
- package/dist/components/progress/LoadingIndicator.d.ts +5 -0
- package/dist/components/progress/Progress.d.ts +8 -0
- package/dist/fonts/Inter-Bold.ttf +0 -0
- package/dist/fonts/Inter-Regular.ttf +0 -0
- package/dist/fonts/Inter-SemiBold.ttf +0 -0
- package/dist/fonts/OFL.txt +92 -0
- package/dist/fonts/inter-4.1.provenance.json +41 -0
- package/dist/fonts.css +21 -0
- package/dist/foundations/tokens.d.ts +168 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.js +1121 -0
- package/dist/styles.css +3 -0
- package/dist/theme.css +97 -0
- package/docs/components.md +182 -0
- package/docs/installation.md +145 -0
- package/docs/styling.md +92 -0
- package/docs/verification.md +80 -0
- package/package.json +107 -4
package/dist/styles.css
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer theme,base;@layer components{.pancake-button{min-width:var(--spacing-pancake-112);border-radius:var(--radius-pancake-full);padding-inline:var(--spacing-pancake-24);font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);appearance:none;box-sizing:border-box;justify-content:center;align-items:center;gap:var(--spacing-pancake-8);cursor:pointer;padding-block:var(--spacing-pancake-8);text-align:center;border:0;display:inline-flex}.pancake-button--40{min-height:var(--spacing-pancake-40)}.pancake-button--48{min-height:var(--spacing-pancake-48)}.pancake-button--primary{background-color:var(--color-pancake-accent)}.pancake-button--secondary{background-color:var(--color-pancake-surface)}.pancake-button--destructive{background-color:var(--color-pancake-danger)}.pancake-button--ghost{background-color:var(--color-pancake-canvas)}.pancake-button--primary:hover:not(:disabled):not([aria-disabled=true]),.pancake-button--primary:active:not(:disabled):not([aria-disabled=true]){background-color:var(--color-pancake-surface-accent)}.pancake-button--secondary:hover:not(:disabled):not([aria-disabled=true]),.pancake-button--ghost:hover:not(:disabled):not([aria-disabled=true]){background-color:var(--color-pancake-surface-muted)}.pancake-button--destructive:hover:not(:disabled):not([aria-disabled=true]){background-color:var(--color-pancake-danger-hover)}.pancake-button:disabled{opacity:var(--pancake-opacity-disabled);cursor:not-allowed}.pancake-button:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:var(--spacing-pancake-4)}@media (forced-colors:active){.pancake-button{border:1px solid buttontext}}.pancake-checkbox:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-control-focus);outline-offset:var(--spacing-pancake-4)}.pancake-checkbox-label{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);align-items:center;gap:var(--spacing-pancake-12);cursor:pointer;display:inline-flex}.pancake-checkbox-label:has(.pancake-checkbox:disabled){opacity:var(--pancake-opacity-disabled);cursor:not-allowed}.pancake-checkbox{border-radius:var(--radius-pancake-8);background-color:var(--color-pancake-surface);color:var(--color-pancake-ink);appearance:none;box-sizing:border-box;width:var(--spacing-pancake-40);height:var(--spacing-pancake-40);border:var(--pancake-border-default) solid var(--color-pancake-control-border);cursor:inherit;flex:none;place-content:center;margin:0;display:grid}.pancake-checkbox:checked{background-color:var(--color-pancake-accent)}.pancake-checkbox:checked:before{content:"";width:var(--spacing-pancake-8);height:var(--spacing-pancake-16);border:solid;border-width:0 var(--pancake-focus-ring-width) var(--pancake-focus-ring-width) 0;transform:translateY(-2px)rotate(45deg)}.pancake-checkbox:disabled{background-color:var(--color-pancake-surface-muted)}@media (forced-colors:active){.pancake-checkbox{appearance:auto}.pancake-checkbox:before{display:none}}.pancake-field{font-family:var(--font-pancake);color:var(--color-pancake-ink);width:100%;min-width:0}.pancake-field-label{font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-text-secondary);margin-bottom:var(--spacing-pancake-8);display:block}.pancake-field-input{border-radius:var(--radius-pancake-12);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);box-sizing:border-box;width:100%;min-height:var(--spacing-pancake-52);padding:var(--spacing-pancake-8) var(--spacing-pancake-16);border:var(--pancake-border-default) solid var(--color-pancake-control-border)}.pancake-field-input::placeholder{color:var(--color-pancake-muted);opacity:1}.pancake-field-input:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-control-focus);outline-offset:2px;border-color:var(--color-pancake-focus-ring)}.pancake-field-input[aria-invalid=true]{border-color:var(--color-pancake-error-strong);border-width:2px}.pancake-field-input:disabled{opacity:var(--pancake-opacity-disabled);cursor:not-allowed}.pancake-field-input:read-only{background:var(--color-pancake-surface-muted)}.pancake-field-description{font-size:var(--text-pancake-caption);line-height:var(--tw-leading,var(--text-pancake-caption--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-caption--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-caption--font-weight));margin:var(--spacing-pancake-4) 0 0}.pancake-stack,.pancake-inline{box-sizing:border-box;min-width:0;display:flex}.pancake-stack{flex-direction:column}.pancake-inline{flex-direction:row}.pancake-text{overflow-wrap:anywhere;margin:0}.pancake-avatar{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-info);font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);box-sizing:border-box;vertical-align:middle;flex:none;justify-content:center;align-items:center;display:inline-flex;overflow:hidden}.pancake-avatar img{object-fit:cover;width:100%;height:100%}.pancake-avatar-group{gap:var(--spacing-pancake-4);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}.pancake-avatar-group li{display:flex}.pancake-avatar-overflow{background-color:var(--color-pancake-surface-muted)}.pancake-status-chip{border-radius:var(--radius-pancake-full);font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);box-sizing:border-box;min-height:var(--spacing-pancake-36);padding:var(--spacing-pancake-4) var(--spacing-pancake-12);overflow-wrap:anywhere;justify-content:center;align-items:center;display:inline-flex}.pancake-tone-neutral{background-color:var(--color-pancake-surface-muted)}.pancake-tone-success{background-color:var(--color-pancake-surface-accent)}.pancake-tone-warning{background-color:var(--color-pancake-warning)}.pancake-tone-danger{background-color:var(--color-pancake-danger)}.pancake-tone-info{background-color:var(--color-pancake-info)}.pancake-banner{border-radius:var(--radius-pancake-16);font-family:var(--font-pancake);color:var(--color-pancake-ink);box-sizing:border-box;align-items:center;gap:var(--spacing-pancake-8);padding:var(--spacing-pancake-12);min-height:var(--spacing-pancake-72);width:100%;display:flex}.pancake-banner-copy{overflow-wrap:anywhere;flex:1;min-width:0}.pancake-banner-title{font-size:var(--text-pancake-body-strong);line-height:var(--tw-leading,var(--text-pancake-body-strong--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body-strong--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body-strong--font-weight));display:block}.pancake-banner-description{font-size:var(--text-pancake-caption);line-height:var(--tw-leading,var(--text-pancake-caption--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-caption--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-caption--font-weight));color:var(--color-pancake-text-secondary);margin-top:var(--spacing-pancake-4)}.pancake-banner-dismiss{border-radius:var(--radius-pancake-full);font-family:var(--font-pancake);color:var(--color-pancake-ink);cursor:pointer;min-width:var(--spacing-pancake-44);min-height:var(--spacing-pancake-44);background:0 0;border:none;flex:none;font-size:24px}.pancake-banner-dismiss:hover{background-color:var(--color-pancake-surface)}.pancake-banner-dismiss:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:2px}.pancake-empty-state{font-family:var(--font-pancake);color:var(--color-pancake-ink);text-align:center;padding:var(--spacing-pancake-24);overflow-wrap:anywhere}.pancake-empty-icon{margin-bottom:var(--spacing-pancake-16)}.pancake-empty-title{font-size:var(--text-pancake-heading);line-height:var(--tw-leading,var(--text-pancake-heading--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-heading--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-heading--font-weight));margin:0}.pancake-empty-description{font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-text-secondary);margin-top:var(--spacing-pancake-8)}.pancake-empty-action{margin-top:var(--spacing-pancake-20)}.pancake-section-header,.pancake-app-header{font-family:var(--font-pancake);color:var(--color-pancake-ink);justify-content:space-between;align-items:center;gap:var(--spacing-pancake-16);min-height:var(--spacing-pancake-44);flex-wrap:wrap;display:flex}.pancake-app-header{border-radius:var(--radius-pancake-20);background-color:var(--color-pancake-canvas);min-height:var(--spacing-pancake-88);padding:var(--spacing-pancake-16);box-sizing:border-box}.pancake-header-copy{overflow-wrap:anywhere;flex:160px;min-width:0}.pancake-section-title{font-size:var(--text-pancake-heading);line-height:var(--tw-leading,var(--text-pancake-heading--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-heading--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-heading--font-weight));margin:0}.pancake-app-title{font-size:var(--text-pancake-title);line-height:var(--tw-leading,var(--text-pancake-title--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-title--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-title--font-weight));margin:0}.pancake-header-description{font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-text-secondary);margin:var(--spacing-pancake-8) 0 0}.pancake-header-action{flex:0 auto;max-width:100%}.pancake-bottom-navigation{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);color:var(--color-pancake-ink);border:var(--pancake-border-default) solid var(--color-pancake-border)}.pancake-bottom-navigation ul{box-sizing:border-box;padding:var(--spacing-pancake-8);gap:var(--spacing-pancake-4);flex-wrap:wrap;margin:0;list-style:none;display:flex}.pancake-bottom-navigation li{flex:80px;min-width:0;display:flex}.pancake-bottom-navigation a{border-radius:var(--radius-pancake-12);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-text-secondary);justify-content:center;align-items:center;gap:var(--spacing-pancake-4);padding:var(--spacing-pancake-8);min-height:var(--spacing-pancake-48);box-sizing:border-box;text-align:center;overflow-wrap:anywhere;flex-direction:column;flex:1;text-decoration:none;display:flex}.pancake-bottom-navigation a[aria-current=page]{background-color:var(--color-pancake-accent);color:var(--color-pancake-ink)}.pancake-bottom-navigation a:hover{text-decoration:underline}.pancake-bottom-navigation a:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:2px}.pancake-segmented-control{font-family:var(--font-pancake);color:var(--color-pancake-ink);border:0;min-width:0;margin:0;padding:0}.pancake-segmented-control legend{font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));margin-bottom:var(--spacing-pancake-8);padding:0}.pancake-segments{border-radius:var(--radius-pancake-20);background-color:var(--color-pancake-surface-muted);gap:var(--spacing-pancake-4);padding:var(--spacing-pancake-4);flex-wrap:wrap;display:flex}.pancake-segment{cursor:pointer;flex:80px;min-width:0;display:flex;position:relative}.pancake-segment input{opacity:0;width:100%;height:100%;cursor:inherit;margin:0;position:absolute;inset:0}.pancake-segment>span{border-radius:var(--radius-pancake-20);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));box-sizing:border-box;width:100%;min-height:var(--spacing-pancake-48);padding:var(--spacing-pancake-8) var(--spacing-pancake-12);text-align:center;overflow-wrap:anywhere;border:var(--pancake-border-default) solid transparent;justify-content:center;align-items:center;display:flex}.pancake-segment input:checked+span{text-underline-offset:var(--spacing-pancake-4);background-color:var(--color-pancake-surface);text-decoration:underline}.pancake-segment input:focus-visible+span{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:2px}.pancake-segment input:disabled{cursor:not-allowed}.pancake-segment input:disabled+span{opacity:var(--pancake-opacity-disabled)}.pancake-step-progress{font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);gap:var(--spacing-pancake-16);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}.pancake-step-progress li{align-items:center;gap:var(--spacing-pancake-8);overflow-wrap:anywhere;min-width:0;display:flex}.pancake-step-number{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-surface-muted);width:var(--spacing-pancake-32);height:var(--spacing-pancake-32);flex:none;place-items:center;display:grid}.pancake-step-progress [data-complete] .pancake-step-number{background-color:var(--color-pancake-accent)}.pancake-step-progress [aria-current=step] .pancake-step-number{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep)}.pancake-navigation-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (forced-colors:active){.pancake-segment input:checked+span{border:2px solid highlight}.pancake-bottom-navigation a[aria-current=page]{outline:2px solid highlight}}.pancake-surface{border-radius:var(--radius-pancake-16);background-color:var(--color-pancake-surface);padding:var(--spacing-pancake-24);font-family:var(--font-pancake);color:var(--color-pancake-ink);box-sizing:border-box}.pancake-textarea{resize:vertical;display:block}.pancake-select-control{position:relative}.pancake-select{appearance:none;padding-inline-end:var(--spacing-pancake-40)}.pancake-select:read-only{background:var(--color-pancake-surface)}.pancake-select-control .pancake-select:disabled+.pancake-select-chevron{opacity:var(--pancake-opacity-disabled)}.pancake-select-chevron{pointer-events:none;inset-inline-end:var(--spacing-pancake-16);align-items:center;display:flex;position:absolute;top:0;bottom:0}.pancake-icon-button{flex-shrink:0;min-width:0;padding:0}.pancake-icon-button.pancake-button--40{width:var(--spacing-pancake-40);height:var(--spacing-pancake-40)}.pancake-icon-button.pancake-button--48{width:var(--spacing-pancake-48);height:var(--spacing-pancake-48)}.pancake-icon-button-icon{width:var(--spacing-pancake-24);height:var(--spacing-pancake-24);justify-content:center;align-items:center;display:inline-flex}.pancake-button-link{overflow-wrap:anywhere;max-width:100%;text-decoration:none}.pancake-dialog{border-radius:var(--radius-pancake-16);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);color:var(--color-pancake-ink);box-sizing:border-box;width:calc(100% - var(--spacing-pancake-48));max-width:var(--spacing-pancake-560);max-height:calc(100% - var(--spacing-pancake-48));padding:var(--spacing-pancake-24);border:var(--pancake-border-default) solid var(--color-pancake-border);overflow-wrap:anywhere;overflow:auto}.pancake-dialog::backdrop{background:var(--color-pancake-deep);opacity:var(--pancake-opacity-overlay)}.pancake-radio-group{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);border:0;min-width:0;margin:0;padding:0}.pancake-radio-legend{font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));margin-bottom:var(--spacing-pancake-8);padding:0}.pancake-radio-options{gap:var(--spacing-pancake-8);display:grid}.pancake-radio-option{align-items:center;gap:var(--spacing-pancake-12);min-height:var(--spacing-pancake-40);cursor:pointer;display:flex}.pancake-radio-input{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-surface);appearance:none;box-sizing:border-box;border:var(--pancake-border-default) solid var(--color-pancake-control-border);width:var(--spacing-pancake-24);height:var(--spacing-pancake-24);margin:var(--spacing-pancake-8);cursor:inherit;flex:none;place-content:center;display:grid}.pancake-radio-input:checked{background-color:var(--color-pancake-accent)}.pancake-radio-input:checked:before{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-deep);content:"";width:var(--spacing-pancake-12);height:var(--spacing-pancake-12)}.pancake-radio-input:focus{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-control-focus);outline-offset:var(--spacing-pancake-4)}.pancake-radio-option:has(.pancake-radio-input:disabled){opacity:var(--pancake-opacity-disabled);cursor:not-allowed}.pancake-radio-copy{overflow-wrap:anywhere;min-width:0;display:grid}.pancake-radio-description{font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-muted);margin-top:var(--spacing-pancake-4);display:block}@media (forced-colors:active){.pancake-radio-input{appearance:auto}.pancake-radio-input:before{display:none}}.pancake-switch-label{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);align-items:center;gap:var(--spacing-pancake-12);cursor:pointer;display:inline-flex}.pancake-switch{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-surface-muted);appearance:none;box-sizing:border-box;width:var(--spacing-pancake-64);height:var(--spacing-pancake-40);border:var(--pancake-border-default) solid var(--color-pancake-control-border);cursor:inherit;flex:none;margin:0;position:relative}.pancake-switch:before{border-radius:var(--radius-pancake-full);background-color:var(--color-pancake-deep);content:"";width:var(--spacing-pancake-24);height:var(--spacing-pancake-24);position:absolute;inset-block-start:calc(var(--spacing-pancake-8) - var(--pancake-border-default));inset-inline-start:calc(var(--spacing-pancake-8) - var(--pancake-border-default))}.pancake-switch:checked{background-color:var(--color-pancake-accent)}.pancake-switch:checked:before{inset-inline-start:calc(var(--spacing-pancake-32) - var(--pancake-border-default))}.pancake-switch:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-control-focus);outline-offset:var(--spacing-pancake-4)}.pancake-switch-label:has(.pancake-switch:disabled){opacity:var(--pancake-opacity-disabled);cursor:not-allowed}@media (forced-colors:active){.pancake-switch{appearance:auto}.pancake-switch:before{display:none}}.pancake-tabs{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);min-width:0}.pancake-tabs-list{gap:var(--spacing-pancake-8);padding:var(--spacing-pancake-8);flex-wrap:wrap;display:flex}.pancake-tabs-list--vertical{flex-direction:column;align-items:stretch}.pancake-tabs-tab{border-radius:var(--radius-pancake-12);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);min-height:var(--spacing-pancake-48);min-width:0;max-width:100%;padding:var(--spacing-pancake-12) var(--spacing-pancake-16);border:var(--pancake-border-default) solid transparent;cursor:pointer;overflow-wrap:anywhere}.pancake-tabs-tab[aria-selected=true]{background-color:var(--color-pancake-accent);text-underline-offset:var(--spacing-pancake-4);text-decoration:underline}.pancake-tabs-tab:hover:not(:disabled){background-color:var(--color-pancake-surface-muted)}.pancake-tabs-tab[aria-selected=true]:hover:not(:disabled){background-color:var(--color-pancake-surface-accent)}.pancake-tabs-tab:disabled{opacity:var(--pancake-opacity-disabled);cursor:not-allowed}.pancake-tabs-tab:focus-visible,.pancake-tabs-panel:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:var(--spacing-pancake-4)}.pancake-tabs-panel{padding:var(--spacing-pancake-16) var(--spacing-pancake-8);overflow-wrap:anywhere}.pancake-disclosure{border-radius:var(--radius-pancake-16);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);border:var(--pancake-border-default) solid var(--color-pancake-border);overflow-wrap:anywhere;min-width:0}.pancake-disclosure-summary{font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));padding:var(--spacing-pancake-16);cursor:pointer}.pancake-disclosure-summary:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-control-focus);outline-offset:var(--spacing-pancake-4)}.pancake-disclosure-content{padding:0 var(--spacing-pancake-16) var(--spacing-pancake-16)}.pancake-progress-field{gap:var(--spacing-pancake-8);min-width:0;display:grid}.pancake-progress-label{font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);overflow-wrap:anywhere}.pancake-progress{width:100%;height:var(--spacing-pancake-16);accent-color:var(--color-pancake-deep)}.pancake-loading-indicator{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);align-items:center;gap:var(--spacing-pancake-8);overflow-wrap:anywhere;display:flex}.pancake-loading-dots{gap:var(--spacing-pancake-4);flex-shrink:0;display:inline-flex}.pancake-loading-dot{border-radius:var(--radius-pancake-full);width:var(--spacing-pancake-4);height:var(--spacing-pancake-4);background:currentColor}.pancake-file-field{min-width:0}.pancake-file-field:read-only{background:var(--color-pancake-surface)}.pancake-file-field::file-selector-button{border-radius:var(--radius-pancake-full);font-family:var(--font-pancake);font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));color:var(--color-pancake-ink);background:var(--color-pancake-surface-muted);padding:var(--spacing-pancake-8) var(--spacing-pancake-12);cursor:pointer;border:none;margin-inline-end:var(--spacing-pancake-8)}.pancake-file-field:disabled::file-selector-button{cursor:not-allowed}.pancake-popover{border-radius:var(--radius-pancake-16);background-color:var(--color-pancake-surface);font-family:var(--font-pancake);color:var(--color-pancake-ink);box-sizing:border-box;position-anchor:auto;position-area:block-end;position-try-fallbacks:flip-block;position-try-order:most-height;margin:var(--spacing-pancake-8);width:var(--spacing-pancake-320);max-width:calc(100% - var(--spacing-pancake-32));max-height:calc(100% - var(--spacing-pancake-32));padding:var(--spacing-pancake-24);border:var(--pancake-border-default) solid var(--color-pancake-border);overflow-wrap:anywhere;position:fixed;inset:auto;overflow:auto}.pancake-dropdown-menu{padding:var(--spacing-pancake-8)}.pancake-dropdown-menu-item{border-radius:var(--radius-pancake-8);background-color:var(--color-pancake-transparent);font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);box-sizing:border-box;width:100%;min-height:var(--spacing-pancake-40);padding:var(--spacing-pancake-12) var(--spacing-pancake-8);border:var(--spacing-pancake-0);text-align:start;overflow-wrap:anywhere;cursor:pointer;text-decoration:none;display:block}.pancake-dropdown-menu-item:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:var(--pancake-focus-ring-width)}.pancake-dropdown-menu-item:hover{background-color:var(--color-pancake-surface-muted)}.pancake-dropdown-menu-item[aria-disabled=true]{opacity:var(--pancake-opacity-disabled);cursor:default}.pancake-tooltip-anchor{align-self:flex-start;display:inline-flex}.pancake-tooltip{border-radius:var(--radius-pancake-8);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));width:max-content;max-width:min(var(--spacing-pancake-320), calc(100% - var(--spacing-pancake-32)));padding:var(--spacing-pancake-8);margin:0}.pancake-table-scroll{min-width:0;max-width:100%;overflow:auto}.pancake-table-scroll:focus-visible{outline:var(--pancake-focus-ring-width) solid var(--color-pancake-deep);outline-offset:var(--pancake-focus-ring-width)}.pancake-table{background-color:var(--color-pancake-surface);font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);border-collapse:collapse;text-align:start;width:100%}.pancake-table>caption{font-size:var(--text-pancake-heading);line-height:var(--tw-leading,var(--text-pancake-heading--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-heading--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-heading--font-weight));padding-block:var(--spacing-pancake-16);text-align:start}.pancake-table>thead{background-color:var(--color-pancake-surface-muted)}.pancake-table>thead>tr>th,.pancake-table>tbody>tr>th,.pancake-table>tfoot>tr>th{font-size:var(--text-pancake-label);line-height:var(--tw-leading,var(--text-pancake-label--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-label--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-label--font-weight));text-align:start}.pancake-table>thead>tr>th,.pancake-table>thead>tr>td,.pancake-table>tbody>tr>th,.pancake-table>tbody>tr>td,.pancake-table>tfoot>tr>th,.pancake-table>tfoot>tr>td{min-width:var(--spacing-pancake-112);padding:var(--spacing-pancake-16);border-bottom:var(--pancake-border-default) solid var(--color-pancake-border);vertical-align:top}.pancake-pagination{font-family:var(--font-pancake);font-size:var(--text-pancake-body);line-height:var(--tw-leading,var(--text-pancake-body--line-height));letter-spacing:var(--tw-tracking,var(--text-pancake-body--letter-spacing));font-weight:var(--tw-font-weight,var(--text-pancake-body--font-weight));color:var(--color-pancake-ink);min-width:0}.pancake-pagination-list{align-items:center;gap:var(--spacing-pancake-8);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}.pancake-pagination-list>li{min-width:0;max-width:100%;display:flex}.pancake-pagination-control{min-width:var(--spacing-pancake-40);max-width:100%;padding-inline:var(--spacing-pancake-12);overflow-wrap:anywhere}.pancake-pagination-unavailable{opacity:var(--pancake-opacity-disabled);cursor:default}.pancake-pagination .pancake-pagination-unavailable.pancake-button:hover{box-shadow:none}.pancake-pagination-gap{padding-inline:var(--spacing-pancake-4)}}@layer utilities;:root,:host{--color-pancake-accent:#ade533;--color-pancake-accent-disabled-layer:#ade533cc;--color-pancake-border:#edede8;--color-pancake-canvas:#fbf8f0;--color-pancake-control-border:#7e8c70;--color-pancake-control-focus:#647a45;--color-pancake-error-strong:#a34c3e;--color-pancake-danger:#ffd6d6;--color-pancake-danger-hover:#ffc2c2;--color-pancake-deep:#384540;--color-pancake-info:#d6edfa;--color-pancake-ink:#0e1716;--color-pancake-muted:#636b6e;--color-pancake-olive:#636657;--color-pancake-surface:#fff;--color-pancake-surface-accent:#d1f28a;--color-pancake-surface-muted:#f0f0eb;--color-pancake-text-secondary:#3b4742;--color-pancake-transparent:transparent;--color-pancake-warning:#ffeb9e;--color-pancake-focus-ring:#ade533;--spacing-pancake-0:0px;--spacing-pancake-4:4px;--spacing-pancake-8:8px;--spacing-pancake-12:12px;--spacing-pancake-16:16px;--spacing-pancake-20:20px;--spacing-pancake-24:24px;--spacing-pancake-28:28px;--spacing-pancake-32:32px;--spacing-pancake-36:36px;--spacing-pancake-40:40px;--spacing-pancake-44:44px;--spacing-pancake-48:48px;--spacing-pancake-52:52px;--spacing-pancake-56:56px;--spacing-pancake-64:64px;--spacing-pancake-72:72px;--spacing-pancake-76:76px;--spacing-pancake-80:80px;--spacing-pancake-88:88px;--spacing-pancake-92:92px;--spacing-pancake-104:104px;--spacing-pancake-112:112px;--spacing-pancake-320:320px;--spacing-pancake-560:560px;--radius-pancake-12:12px;--radius-pancake-16:16px;--radius-pancake-20:20px;--radius-pancake-28:28px;--radius-pancake-36:36px;--radius-pancake-8:8px;--radius-pancake-full:999px;--font-pancake:Inter, sans-serif;--text-pancake-body:14px;--text-pancake-body--line-height:16.8px;--text-pancake-body--font-weight:400;--text-pancake-body--letter-spacing:0px;--text-pancake-body-strong:15px;--text-pancake-body-strong--line-height:18px;--text-pancake-body-strong--font-weight:600;--text-pancake-body-strong--letter-spacing:0px;--text-pancake-caption:11px;--text-pancake-caption--line-height:13.2px;--text-pancake-caption--font-weight:400;--text-pancake-caption--letter-spacing:0px;--text-pancake-display:28px;--text-pancake-display--line-height:33.6px;--text-pancake-display--font-weight:700;--text-pancake-display--letter-spacing:0px;--text-pancake-heading:18px;--text-pancake-heading--line-height:21.6px;--text-pancake-heading--font-weight:700;--text-pancake-heading--letter-spacing:0px;--text-pancake-label:12px;--text-pancake-label--line-height:14.4px;--text-pancake-label--font-weight:600;--text-pancake-label--letter-spacing:0px;--text-pancake-micro:10px;--text-pancake-micro--line-height:12px;--text-pancake-micro--font-weight:600;--text-pancake-micro--letter-spacing:0px;--text-pancake-section:20px;--text-pancake-section--line-height:24px;--text-pancake-section--font-weight:700;--text-pancake-section--letter-spacing:0px;--text-pancake-title:25px;--text-pancake-title--line-height:30px;--text-pancake-title--font-weight:700;--text-pancake-title--letter-spacing:0px;--pancake-border-default:1px;--pancake-focus-ring-width:2px;--pancake-opacity-disabled:.4;--pancake-opacity-overlay:.5}
|
|
3
|
+
/*$vite$:1*/
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* Generated by scripts/generate-theme.mjs. Edit src/foundations/tokens.ts. */
|
|
2
|
+
@theme static {
|
|
3
|
+
--color-pancake-accent: #ade533;
|
|
4
|
+
--color-pancake-accent-disabled-layer: rgba(173, 229, 51, 0.8);
|
|
5
|
+
--color-pancake-border: #edede8;
|
|
6
|
+
--color-pancake-canvas: #fbf8f0;
|
|
7
|
+
--color-pancake-control-border: #7e8c70;
|
|
8
|
+
--color-pancake-control-focus: #647a45;
|
|
9
|
+
--color-pancake-error-strong: #a34c3e;
|
|
10
|
+
--color-pancake-danger: #ffd6d6;
|
|
11
|
+
--color-pancake-danger-hover: #ffc2c2;
|
|
12
|
+
--color-pancake-deep: #384540;
|
|
13
|
+
--color-pancake-info: #d6edfa;
|
|
14
|
+
--color-pancake-ink: #0e1716;
|
|
15
|
+
--color-pancake-muted: #636b6e;
|
|
16
|
+
--color-pancake-olive: #636657;
|
|
17
|
+
--color-pancake-surface: #ffffff;
|
|
18
|
+
--color-pancake-surface-accent: #d1f28a;
|
|
19
|
+
--color-pancake-surface-muted: #f0f0eb;
|
|
20
|
+
--color-pancake-text-secondary: #3b4742;
|
|
21
|
+
--color-pancake-transparent: transparent;
|
|
22
|
+
--color-pancake-warning: #ffeb9e;
|
|
23
|
+
--color-pancake-focus-ring: #ADE533;
|
|
24
|
+
--spacing-pancake-0: 0px;
|
|
25
|
+
--spacing-pancake-4: 4px;
|
|
26
|
+
--spacing-pancake-8: 8px;
|
|
27
|
+
--spacing-pancake-12: 12px;
|
|
28
|
+
--spacing-pancake-16: 16px;
|
|
29
|
+
--spacing-pancake-20: 20px;
|
|
30
|
+
--spacing-pancake-24: 24px;
|
|
31
|
+
--spacing-pancake-28: 28px;
|
|
32
|
+
--spacing-pancake-32: 32px;
|
|
33
|
+
--spacing-pancake-36: 36px;
|
|
34
|
+
--spacing-pancake-40: 40px;
|
|
35
|
+
--spacing-pancake-44: 44px;
|
|
36
|
+
--spacing-pancake-48: 48px;
|
|
37
|
+
--spacing-pancake-52: 52px;
|
|
38
|
+
--spacing-pancake-56: 56px;
|
|
39
|
+
--spacing-pancake-64: 64px;
|
|
40
|
+
--spacing-pancake-72: 72px;
|
|
41
|
+
--spacing-pancake-76: 76px;
|
|
42
|
+
--spacing-pancake-80: 80px;
|
|
43
|
+
--spacing-pancake-88: 88px;
|
|
44
|
+
--spacing-pancake-92: 92px;
|
|
45
|
+
--spacing-pancake-104: 104px;
|
|
46
|
+
--spacing-pancake-112: 112px;
|
|
47
|
+
--spacing-pancake-320: 320px;
|
|
48
|
+
--spacing-pancake-560: 560px;
|
|
49
|
+
--radius-pancake-12: 12px;
|
|
50
|
+
--radius-pancake-16: 16px;
|
|
51
|
+
--radius-pancake-20: 20px;
|
|
52
|
+
--radius-pancake-28: 28px;
|
|
53
|
+
--radius-pancake-36: 36px;
|
|
54
|
+
--radius-pancake-8: 8px;
|
|
55
|
+
--radius-pancake-full: 999px;
|
|
56
|
+
--font-pancake: Inter, sans-serif;
|
|
57
|
+
--text-pancake-body: 14px;
|
|
58
|
+
--text-pancake-body--line-height: 16.8px;
|
|
59
|
+
--text-pancake-body--font-weight: 400;
|
|
60
|
+
--text-pancake-body--letter-spacing: 0px;
|
|
61
|
+
--text-pancake-body-strong: 15px;
|
|
62
|
+
--text-pancake-body-strong--line-height: 18px;
|
|
63
|
+
--text-pancake-body-strong--font-weight: 600;
|
|
64
|
+
--text-pancake-body-strong--letter-spacing: 0px;
|
|
65
|
+
--text-pancake-caption: 11px;
|
|
66
|
+
--text-pancake-caption--line-height: 13.2px;
|
|
67
|
+
--text-pancake-caption--font-weight: 400;
|
|
68
|
+
--text-pancake-caption--letter-spacing: 0px;
|
|
69
|
+
--text-pancake-display: 28px;
|
|
70
|
+
--text-pancake-display--line-height: 33.6px;
|
|
71
|
+
--text-pancake-display--font-weight: 700;
|
|
72
|
+
--text-pancake-display--letter-spacing: 0px;
|
|
73
|
+
--text-pancake-heading: 18px;
|
|
74
|
+
--text-pancake-heading--line-height: 21.6px;
|
|
75
|
+
--text-pancake-heading--font-weight: 700;
|
|
76
|
+
--text-pancake-heading--letter-spacing: 0px;
|
|
77
|
+
--text-pancake-label: 12px;
|
|
78
|
+
--text-pancake-label--line-height: 14.4px;
|
|
79
|
+
--text-pancake-label--font-weight: 600;
|
|
80
|
+
--text-pancake-label--letter-spacing: 0px;
|
|
81
|
+
--text-pancake-micro: 10px;
|
|
82
|
+
--text-pancake-micro--line-height: 12px;
|
|
83
|
+
--text-pancake-micro--font-weight: 600;
|
|
84
|
+
--text-pancake-micro--letter-spacing: 0px;
|
|
85
|
+
--text-pancake-section: 20px;
|
|
86
|
+
--text-pancake-section--line-height: 24px;
|
|
87
|
+
--text-pancake-section--font-weight: 700;
|
|
88
|
+
--text-pancake-section--letter-spacing: 0px;
|
|
89
|
+
--text-pancake-title: 25px;
|
|
90
|
+
--text-pancake-title--line-height: 30px;
|
|
91
|
+
--text-pancake-title--font-weight: 700;
|
|
92
|
+
--text-pancake-title--letter-spacing: 0px;
|
|
93
|
+
--pancake-border-default: 1px;
|
|
94
|
+
--pancake-focus-ring-width: 2px;
|
|
95
|
+
--pancake-opacity-disabled: 0.4;
|
|
96
|
+
--pancake-opacity-overlay: 0.5;
|
|
97
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Component reference
|
|
2
|
+
|
|
3
|
+
For interactive examples, run `npm run storybook` from the repository. [Back to the README](../README.md).
|
|
4
|
+
|
|
5
|
+
## Controls
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Button, Checkbox, TextField } from "@jack.winter/pancake-ui";
|
|
9
|
+
|
|
10
|
+
<form onSubmit={handleSubmit}>
|
|
11
|
+
<TextField
|
|
12
|
+
label="Your name"
|
|
13
|
+
name="name"
|
|
14
|
+
required
|
|
15
|
+
helperText="Your display name."
|
|
16
|
+
/>
|
|
17
|
+
<Checkbox label="Send updates" name="updates" value="yes" />
|
|
18
|
+
<Button type="submit">Save preferences</Button>
|
|
19
|
+
</form>;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`Button` defaults to `type="button"` to prevent accidental form submission. Its `variant` is `primary`, `secondary`, `destructive`, or `ghost`; `size` is 40 or 48. `loading` sets `aria-busy` and disables activation while preserving the label. All variants support disabled/loading states and both sizes.
|
|
23
|
+
|
|
24
|
+
`TextField` requires a visible `label`; supports text, email, password, search, tel, and URL inputs; and uses ordinary `value`/`defaultValue` and `onChange` props. `helperText` and `error` link to the input's accessible description. An error sets `aria-invalid`; application validation remains the caller's responsibility. `className` and `ref` target the input. Password visibility toggles and explicit search-clear actions are not built in.
|
|
25
|
+
|
|
26
|
+
`Checkbox` requires a visible `label`. Use `checked` and `onCheckedChange` for controlled state, or `defaultChecked` for uncontrolled state. Native `onChange` remains available and runs before `onCheckedChange`. Native form reset applies to uncontrolled inputs; controlled state must be reset by the application. `className` and `ref` target the checkbox input.
|
|
27
|
+
|
|
28
|
+
The sample form verifies submission, required fields, custom errors, keyboard focus, controlled and uncontrolled checkboxes, and loading/disabled states. Form controls use olive border and focus tokens, with a warm error border.
|
|
29
|
+
|
|
30
|
+
## Reusable catalogue
|
|
31
|
+
|
|
32
|
+
| Area | Components |
|
|
33
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
34
|
+
| Layout and typography | `Stack`, `Inline`, `Text`, `Surface` |
|
|
35
|
+
| Actions | `Button`, `ButtonLink`, `IconButton` |
|
|
36
|
+
| Forms | `TextField`, `Textarea`, `Select`, `FileField`, `Checkbox`, `RadioGroup`, `Switch`, `SegmentedControl` |
|
|
37
|
+
| Navigation | `AppHeader`, `SectionHeader`, `BottomNavigation`, `Tabs`, `Pagination` |
|
|
38
|
+
| Overlays and disclosure | `Dialog`, `Popover`, `DropdownMenu`, `Tooltip`, `Disclosure` |
|
|
39
|
+
| Data and identity | `Table`, `Avatar`, `AvatarGroup` |
|
|
40
|
+
| Feedback and progress | `StatusChip`, `BannerToast`, `EmptyState`, `Progress`, `LoadingIndicator`, `StepProgress` |
|
|
41
|
+
|
|
42
|
+
`Stack` and `Inline` accept spacing token names (`gap="space24"`), alignment, padding, and native div props. Inline wraps by default. `Text` accepts a typography `variant`, colour token, and an `as` tag for semantic headings or paragraphs. Layout and text reference CSS variables so local themes apply.
|
|
43
|
+
|
|
44
|
+
`Avatar` requires a name, accepts an optional image `src`, and falls back to initials after a failed image. Changing `src` retries the image. Use `decorative` when adjacent text already supplies the name. `AvatarGroup` accepts `{ id, name, src? }` items and a positive integer `max`; hidden identities are named on the overflow indicator.
|
|
45
|
+
|
|
46
|
+
`StatusChip` tones are neutral, success, warning, danger, and info. `BannerToast` accepts a title, children, an optional `onDismiss`, and success/warning/error/info tones. Error notifications use an alert; other tones use a polite status. Applications own notification timing and dismissal state. `EmptyState` accepts title, description, optional decorative icon, and action content.
|
|
47
|
+
|
|
48
|
+
`AppHeader` provides title, description, and leading/trailing slots. `SectionHeader` provides title, description, action, and heading levels 2–4. `BottomNavigation` takes `{ id, label, href, icon? }` items and `activeId`; navigation and active-route state remain with the application. It is in normal document flow rather than fixed to the viewport.
|
|
49
|
+
|
|
50
|
+
`SegmentedControl` is a labelled selection field, not a tab-panel widget. It accepts `{ value, label, disabled? }` options, native `name`, `disabled`, `required`, and `form` props, plus either `value`/`onValueChange` or `defaultValue`. Native radio keyboard navigation and uncontrolled form reset apply. Controlled selections must be reset by the caller. Use unique values per group and an explicit name for submitted data.
|
|
51
|
+
|
|
52
|
+
`StepProgress` takes a non-empty list of step labels and zero-based `currentStep`. A value equal to `steps.length` marks all steps complete. The current item exposes `aria-current="step"`.
|
|
53
|
+
|
|
54
|
+
The example verifies avatar image recovery, notification dismissal, navigation links, selection keyboard behaviour and form reset, progress semantics, and local theme overrides. Product-specific screens, workflows, and branded artwork belong in consuming apps.
|
|
55
|
+
|
|
56
|
+
## Textarea and Select
|
|
57
|
+
|
|
58
|
+
`Textarea` and `Select` provide labelled multiline and native selection controls with `helperText`, `error`, native form props, and refs to their controls. Supply `option` and `optgroup` children to `Select`. Like `TextField`, their `className` and `style` props target the control.
|
|
59
|
+
|
|
60
|
+
`Select` accepts one scalar value, not `multiple` or listbox `size`. Uncontrolled controls use native form reset. For controlled forms, the app owns reset: restore state and reapply a select’s value after the native reset completes, including when the initial state has not changed. The contract fixture demonstrates this ordering.
|
|
61
|
+
|
|
62
|
+
## IconButton and ButtonLink
|
|
63
|
+
|
|
64
|
+
`IconButton` requires a `label` for its accessible name and renders decorative icon children. It shares Button variants, sizes, loading/disabled states and native button props. `ButtonLink` shares button styling but renders a native anchor with a required `href`; it supports anchor refs and link props, without fake disabled or loading states.
|
|
65
|
+
|
|
66
|
+
## Dialog
|
|
67
|
+
|
|
68
|
+
`Dialog` is a controlled native modal. Pass `open`, `onOpenChange` and a visible `title`; an optional `description` is associated with the dialog. It uses `showModal()` after mounting, so server markup is stable and the modal opens after hydration. The browser owns modal focus containment and background inertness. Escape and the built-in close button request dismissal through `onOpenChange(false)`; the app must update `open`. Backdrop clicks do not dismiss it. Set `closeLabel` to localise the close button. Native refs, classes and styles target the dialog element.
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const [open, setOpen] = useState(false);
|
|
72
|
+
|
|
73
|
+
<>
|
|
74
|
+
<Button onClick={() => setOpen(true)}>Review changes</Button>
|
|
75
|
+
<Dialog open={open} onOpenChange={setOpen} title="Review changes">
|
|
76
|
+
<Text as="p">Check your changes before saving.</Text>
|
|
77
|
+
<Button onClick={() => setOpen(false)}>Done</Button>
|
|
78
|
+
</Dialog>
|
|
79
|
+
</>;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## RadioGroup and Switch
|
|
83
|
+
|
|
84
|
+
`RadioGroup` provides labelled native radio choices with optional option descriptions, group guidance/errors and disabled options. Use unique option values and `value`/`onValueChange` or `defaultValue`. `Switch` provides a labelled native checkbox with switch semantics and `onCheckedChange`; applications own the setting it changes. Native form props and consumer styling remain supported.
|
|
85
|
+
|
|
86
|
+
## Tabs
|
|
87
|
+
|
|
88
|
+
`Tabs` takes a labelled `items` array with unique `value` identifiers, visible `label` content and panel `content`. It supports `value`/`onValueChange` or `defaultValue`, horizontal/vertical orientation, and automatic or manual activation. Arrow keys, Home and End move between enabled tabs; manual activation uses Enter or Space. Horizontal arrows follow inherited text direction. Invalid or disabled selections fall back to the first enabled item without emitting a change callback. Panels stay mounted when hidden so child state survives selection changes. Keep tab labels noninteractive; refs and consumer styling target the root div.
|
|
89
|
+
|
|
90
|
+
## Disclosure
|
|
91
|
+
|
|
92
|
+
`Disclosure` uses native `details` and `summary`. Supply a concise, noninteractive `summary` and content children. Use `defaultOpen` for uncontrolled state, or `open` with `onOpenChange` for controlled state. Uncontrolled disclosures may share a native `name` to form an exclusive accordion group; controlled disclosures must be coordinated by the application and cannot use `name`. Native `onToggle` is forwarded, while `onOpenChange` reports state changes/requests without treating initial open state as a user change. Refs and consumer styling target the details element.
|
|
93
|
+
|
|
94
|
+
## Progress and LoadingIndicator
|
|
95
|
+
|
|
96
|
+
`Progress` shows a task's completion using a native progress element. Supply a visible `label` and numeric `value`; `max` defaults to 100. Omit `value` for indeterminate progress. Native progress semantics handle the range; this is task completion, not a measurement meter. Refs, native props, `className` and `style` target the progress element.
|
|
97
|
+
|
|
98
|
+
`LoadingIndicator` shows a visible `label` in a polite status region. Keep the component mounted while changing its label so assistive technology can observe updates. The decorative marker is static, so loading does not depend on motion. Applications own requests, cancellation and the affected region's `aria-busy` state. Automated tests verify markup and updates; they do not prove announcements in every screen reader.
|
|
99
|
+
|
|
100
|
+
## Numeric and temporal fields
|
|
101
|
+
|
|
102
|
+
`TextField` also supports native `number`, `date`, `time` and `datetime-local` controls. Pass native `min`, `max`, `step` and `required` constraints. Change events retain browser string values; read `event.currentTarget.valueAsNumber` for numeric conversion (empty input yields `NaN`). Dates use `YYYY-MM-DD`, times use `HH:mm` and local date-times use `YYYY-MM-DDTHH:mm`; `datetime-local` does not supply a time zone. Native picker presentation follows the browser and operating system.
|
|
103
|
+
|
|
104
|
+
## FileField
|
|
105
|
+
|
|
106
|
+
`FileField` provides a labelled native file input with the same helper/error treatment as other fields. Use `accept`, `multiple`, `required` and `onChange`; selected files are available through `event.currentTarget.files`, refs or native `FormData`. File selection is uncontrolled: `value`, `defaultValue` and `readOnly` are deliberately excluded. Native form reset clears the selection. `accept` is a picker hint, not validation; applications own file validation and upload transport. Consumer `className`, `style` and refs target the input.
|
|
107
|
+
|
|
108
|
+
## Popover
|
|
109
|
+
|
|
110
|
+
`Popover` provides a named, nonmodal contextual region in the browser's top layer. Give it a unique, stable `id` and `label`, and point an ordinary `Button` at that id with `popoverTarget`. A close button uses the same target and `popoverTargetAction="hide"`. Native invocation supplies the positioning anchor. The panel chooses the side with more space, limits its size to the available viewport area and scrolls long content.
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<>
|
|
114
|
+
<Button popoverTarget="project-filters">Filters</Button>
|
|
115
|
+
<Popover id="project-filters" label="Project filters">
|
|
116
|
+
<Stack>
|
|
117
|
+
<Checkbox label="Include archived projects" />
|
|
118
|
+
<Button popoverTarget="project-filters" popoverTargetAction="hide">
|
|
119
|
+
Done
|
|
120
|
+
</Button>
|
|
121
|
+
</Stack>
|
|
122
|
+
</Popover>
|
|
123
|
+
</>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
The browser owns visibility, outside-click dismissal, Escape, sibling/nested popovers and focus navigation. `onOpenChange` observes settled visibility changes; native toggle events may coalesce. There is no controlled `open` or `defaultOpen` prop. `onBeforeToggle` can cancel opening; native closing cannot be cancelled. Refs target the panel div and expose native popover methods; programmatic opening needs a source element to retain an anchor (`ref.current?.showPopover({ source: trigger })`). Children stay mounted while hidden. Consumer styles and native events are preserved. A popover is not a modal dialog or a menu: its contents use ordinary keyboard navigation, and background controls remain usable.
|
|
127
|
+
|
|
128
|
+
## DropdownMenu
|
|
129
|
+
|
|
130
|
+
`DropdownMenu` combines a labelled button with a native anchored action menu. Provide a visible `label` and `items` with unique `id` values. Action items use `{ type: "action", id, label, onSelect }`; link items use `{ type: "link", id, label, href }` and support native `target`, `rel` and `download`. Item labels are strings for keyboard typeahead. Disabled items remain keyboard-focusable for discovery but cannot activate; disabled links have no destination.
|
|
131
|
+
|
|
132
|
+
Enter, Space or ArrowDown opens at the first item; ArrowUp opens at the last. Arrow keys wrap, Home/End reach the edges, and typing searches labels. Escape returns focus to the trigger; Tab/Shift+Tab closes and leaves the composite. Action selection closes the menu and restores trigger focus before calling `onSelect`, so the action can move focus into a new dialog. Browser-owned visibility follows the same native dismissal model as Popover; `onOpenChange` observes settled changes.
|
|
133
|
+
|
|
134
|
+
Native panel props, `className`, `style` and refs target the menu div. Use `triggerProps` for button styling, native handlers and a button ref; behavior-owned trigger attributes remain managed by the component. Empty menus disable their trigger. This component provides a single-level action/link menu; selection fields and hierarchical navigation use different interaction patterns.
|
|
135
|
+
|
|
136
|
+
## Tooltip
|
|
137
|
+
|
|
138
|
+
`Tooltip` adds a supplementary, noninteractive description to one existing focusable element. Pass plain-text `content` and a single inline child that forwards `aria-describedby` to its focusable DOM element, such as `Button`, `IconButton`, `ButtonLink`, or a native button/link. The child's existing descriptions, ref, styling and actions remain intact.
|
|
139
|
+
|
|
140
|
+
```tsx
|
|
141
|
+
<Tooltip content="Download a copy; the original stays unchanged.">
|
|
142
|
+
<Button onClick={downloadProject}>Export project</Button>
|
|
143
|
+
</Tooltip>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Keyboard focus or pointer hover displays the tooltip without moving focus. The pointer can move onto the description; Escape dismisses it. Leaving both focus and hover closes it. Touch activation retains the child's normal action and does not introduce a hover-only interaction. Keep essential instructions visible in the page: touch users and keyboard users of natively disabled controls cannot depend on a tooltip. Use Popover for interactive contextual content. Custom child components must forward the description to their actual focus target; fragments, block-root components such as `TextField`, and multiple focus targets are unsupported. The wrapper is a span, so its child must be valid phrasing content.
|
|
147
|
+
|
|
148
|
+
Tooltip refs and native props target the tooltip span; child refs still target the original child. `onOpenChange` observes settled native visibility changes. Consumer `className` and `style` override the description panel.
|
|
149
|
+
|
|
150
|
+
## Table
|
|
151
|
+
|
|
152
|
+
`Table` renders a native table with a required visible `caption` and a labelled, keyboard-focusable scroll region. Supply native `thead`, `tbody`, `tfoot`, `tr`, `th` and `td` children. Mark column headers with `scope="col"` and row headers with `scope="row"`; use native `colSpan`, `rowSpan`, `id` and `headers` for grouped headers. Cells have a 112px minimum content width plus padding to keep text and embedded controls readable. The wrapper contains horizontal overflow on narrow screens and retains ordinary keyboard navigation for controls inside cells. Table refs, native props, `className` and `style` target the table itself.
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
<Table caption="Project overview">
|
|
156
|
+
<thead>
|
|
157
|
+
<tr>
|
|
158
|
+
<th scope="col">Project</th>
|
|
159
|
+
<th scope="col">Owner</th>
|
|
160
|
+
</tr>
|
|
161
|
+
</thead>
|
|
162
|
+
<tbody>
|
|
163
|
+
<tr>
|
|
164
|
+
<th scope="row">Component library</th>
|
|
165
|
+
<td>Alex Morgan</td>
|
|
166
|
+
</tr>
|
|
167
|
+
</tbody>
|
|
168
|
+
</Table>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Applications own row data, empty/loading rows, selection and sorting. A sortable header can contain a `Button` and expose `aria-sort` on its `th`. Table does not add spreadsheet-style arrow navigation or virtualise rows.
|
|
172
|
+
|
|
173
|
+
## Pagination
|
|
174
|
+
|
|
175
|
+
`Pagination` takes a navigation `label`, one-based `page` and `pageCount`. For local state, supply `onPageChange`; for URL navigation, supply `getPageHref`. Link mode renders real anchors and preserves browser navigation, including opening another tab. Button mode is controlled: requests only become the current page when the application updates `page`. It does not fetch data or move focus into results.
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
<Pagination label="Project pages" page={page} pageCount={12} onPageChange={setPage} />
|
|
179
|
+
<Pagination label="Archive pages" page={page} pageCount={12} getPageHref={(value) => `/archive?page=${value}`} />
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
The current page has `aria-current="page"`; unavailable Previous/Next controls cannot activate. Page numbers stay bounded around the current page, with first/last pages and noninteractive ellipses for gaps. Zero pages has no numbered controls. Counts are truncated and clamped to nonnegative safe integers; invalid counts become zero and the displayed page clamps to the available range without emitting callbacks. Use `labels.previous`, `labels.next` and `labels.page` to localise control text/names. Native refs, props and consumer styling target the navigation element.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Installation and releases
|
|
2
|
+
|
|
3
|
+
[Back to the README](../README.md).
|
|
4
|
+
|
|
5
|
+
## Install in an app
|
|
6
|
+
|
|
7
|
+
Use React and React DOM 19.2+ within React 19, Node 22.18+, and an ESM bundler such as Vite. Tailwind is **not required**. The npm package name is `@jack.winter/pancake-ui`; the unscoped `pancake-ui` package is unrelated. Install the public package with:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @jack.winter/pancake-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Commit the app’s `package.json` and lockfile. For an exact version, use `npm install --save-exact @jack.winter/pancake-ui@0.1.1`.
|
|
14
|
+
|
|
15
|
+
### Install a verified archive
|
|
16
|
+
|
|
17
|
+
Successful **push runs on main** in [Verify](https://github.com/j4ckwinter/pancake-ui/actions/workflows/verify.yml) upload a `pancake-ui-package` artifact containing the exact compiled `.tgz` tested by CI and its `packed.json` manifest. Runs from before package uploads were added have no package artifact; use the local build instructions below if none is available.
|
|
18
|
+
|
|
19
|
+
1. Open a successful main-branch run and download `pancake-ui-package` from its Artifacts section. GitHub requires you to be signed in. Extract the ZIP into your app's `vendor/pancake-ui/` directory.
|
|
20
|
+
2. Install the **`.tgz` inside the ZIP**, from your app's root:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install ./vendor/pancake-ui/jack.winter-pancake-ui-0.1.1.tgz
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use the filename from your download if its version differs. The app needs React and React DOM installed; an existing React app normally already has them. No library clone, Playwright, Tailwind or library build is needed.
|
|
27
|
+
|
|
28
|
+
With [GitHub CLI](https://cli.github.com/) installed and authenticated, you can download the same artifact instead of using the browser. Replace `RUN_ID` with the successful main run's numeric ID:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
gh run download RUN_ID --repo j4ckwinter/pancake-ui --name pancake-ui-package --dir vendor/pancake-ui
|
|
32
|
+
npm install ./vendor/pancake-ui/jack.winter-pancake-ui-0.1.1.tgz
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Commit the downloaded archive, `packed.json`, your app's `package.json`, and its lockfile. Fresh clones can then use `npm ci` without GitHub credentials. Record the source run URL when upgrading, use a new package version, and do not overwrite an archive already used by an app. GitHub artifacts expire after 90 days (or earlier if deleted); keeping the archive in your app makes it independent of that retention period. See [GitHub's artifact download instructions](https://docs.github.com/en/actions/how-tos/manage-workflow-runs/download-workflow-artifacts).
|
|
36
|
+
|
|
37
|
+
Direct Git installation is not a supported distribution path: this repository contains source rather than committed `dist/` files. A Git install can report success without usable exports. Use the registry package after publication or the compiled archive.
|
|
38
|
+
|
|
39
|
+
### Add your first component
|
|
40
|
+
|
|
41
|
+
Import styles once in your app entry point, and optionally import the bundled Inter fonts:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { Button, Stack, Surface, Text } from "@jack.winter/pancake-ui";
|
|
45
|
+
import "@jack.winter/pancake-ui/styles.css";
|
|
46
|
+
import "@jack.winter/pancake-ui/fonts.css"; // Optional bundled Inter fonts.
|
|
47
|
+
|
|
48
|
+
export function Example() {
|
|
49
|
+
return (
|
|
50
|
+
<Surface>
|
|
51
|
+
<Stack gap="space16">
|
|
52
|
+
<Text as="h1" variant="title">
|
|
53
|
+
Your next project
|
|
54
|
+
</Text>
|
|
55
|
+
<Text>Build your app with shared components.</Text>
|
|
56
|
+
<Button>Get started</Button>
|
|
57
|
+
</Stack>
|
|
58
|
+
</Surface>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Exports include `Surface`, `Button`, `TextField`, `Checkbox`, and typed colour, spacing, sizing, radius, border, opacity, and typography tokens. Components accept native element props and React 19 refs. This is an ESM package. React and React DOM are peers and are excluded from the bundle. Consumers do not need Tailwind to use the compiled CSS. The stylesheet does not install a global reset.
|
|
64
|
+
|
|
65
|
+
## Theming
|
|
66
|
+
|
|
67
|
+
For an application without Tailwind, import `@jack.winter/pancake-ui/styles.css` as shown above. Override its CSS variables in your own stylesheet, loaded afterwards:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
:root {
|
|
71
|
+
--color-pancake-accent: #b9e96f;
|
|
72
|
+
--font-pancake: Inter, sans-serif;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
For a Tailwind 4 application, use this in the application's Tailwind stylesheet:
|
|
77
|
+
|
|
78
|
+
```css
|
|
79
|
+
@import "tailwindcss";
|
|
80
|
+
@import "@jack.winter/pancake-ui/styles.css";
|
|
81
|
+
@import "@jack.winter/pancake-ui/theme.css";
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Import that stylesheet once from the application's entry point. The theme enables namespaced utilities such as `bg-pancake-accent`, `p-pancake-24`, and `text-pancake-body`. No scan of the package in `node_modules` is required: component styles already ship compiled. Your own utility classes still need to be included in the consuming application's normal Tailwind source detection. `className` customises the underlying element; it does not perform runtime class-conflict merging.
|
|
85
|
+
|
|
86
|
+
Edit `src/foundations/tokens.ts`, then run `npm run tokens`. `src/foundations/theme.css` is generated; the build refreshes it. Fonts retain the SIL Open Font License in `assets/fonts/OFL.txt` and the distributed fonts directory. Project code is licensed under [MIT](../LICENSE); the registry destination is public npm under `@jack.winter/pancake-ui`.
|
|
87
|
+
|
|
88
|
+
Components use native HTML semantics and namespaced classes authored with Tailwind. No runtime dependencies beyond React peers are needed. Import the styles once at your application entry point. Fonts are opt-in; set `--font-pancake` to use your application’s font.
|
|
89
|
+
|
|
90
|
+
The exported JavaScript tokens (such as `colors` and `typography`) contain default values; CSS overrides do not change those objects. Use components such as `Text`, or CSS `var(--color-pancake-ink)`, when values should respond to a theme. Override related colours together, including `--color-pancake-accent` and `--color-pancake-surface-accent` for primary buttons and their hover state. Check contrast for each theme.
|
|
91
|
+
|
|
92
|
+
The library does not set body styles, page width, or a CSS reset. Set those in your app. The [example application](https://github.com/j4ckwinter/pancake-ui/blob/main/examples/web/src/main.tsx) demonstrates this separation and exercises the component catalogue.
|
|
93
|
+
|
|
94
|
+
## Compatibility and verification
|
|
95
|
+
|
|
96
|
+
The package requires React and React DOM 19.2 or later within React 19 and an ESM-capable bundler. It targets modern browsers supported by Tailwind 4. The browser suite runs in Chromium, Firefox and WebKit. Assistive-technology announcements have not been manually verified. React Native is not supported by this package.
|
|
97
|
+
|
|
98
|
+
For frameworks with React Server Components, import interactive components from a client boundary (for example, a file beginning with `"use client"` in Next.js). Next.js integration is not part of the current verification matrix.
|
|
99
|
+
|
|
100
|
+
`npm run test:package` expects an existing package and Storybook build. It creates an archive under `.tmp/package/` and an isolated app under `.tmp/consumer/`; browser screenshots go to `artifacts/`. It installs the built archive into a separate application, compiles its imports, and exercises the rendered controls. The main example uses compiled CSS without requiring Tailwind in the consumer.
|
|
101
|
+
|
|
102
|
+
## Build an archive locally
|
|
103
|
+
|
|
104
|
+
Use this when working on unpublished changes or before a main-branch CI artifact is available. In a checkout of [j4ckwinter/pancake-ui](https://github.com/j4ckwinter/pancake-ui):
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
git clone https://github.com/j4ckwinter/pancake-ui.git
|
|
108
|
+
cd pancake-ui
|
|
109
|
+
npm ci
|
|
110
|
+
npx playwright install chromium firefox webkit
|
|
111
|
+
npm run release:local
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This runs full verification and produces `artifacts/jack.winter-pancake-ui-0.1.1.tgz`, its SHA-256 checksum and a release manifest recording the source commit and whether the working tree was dirty. Copy the archive into the consuming app's `vendor/pancake-ui/` directory and install it as above. Ordinary `npm pack` builds an archive but does not run the full verification suite.
|
|
115
|
+
|
|
116
|
+
## Versioning releases
|
|
117
|
+
|
|
118
|
+
Before 1.0, use patch versions for compatible fixes and minor versions for additions or breaking API changes. Record breaking changes and migration instructions explicitly in [CHANGELOG.md](../CHANGELOG.md). Do not replace an archive already shared with a different implementation under the same version.
|
|
119
|
+
|
|
120
|
+
For a patch release:
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
npm version patch --no-git-tag-version
|
|
124
|
+
npm --prefix examples/web install
|
|
125
|
+
# Update CHANGELOG.md with the version and changes.
|
|
126
|
+
npm run release:local
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use `minor` instead of `patch` when appropriate. The version command updates the package manifest and lockfile without creating a Git commit or tag. Refreshing the example install updates its local-package metadata. Review and commit those changes through the normal development workflow. Install the new versioned archive in each consumer and keep its lockfile in sync.
|
|
130
|
+
|
|
131
|
+
Local releases do not publish to a registry or upload to GitHub. Bundled Inter fonts retain their SIL Open Font License.
|
|
132
|
+
|
|
133
|
+
## Publish a verified release
|
|
134
|
+
|
|
135
|
+
Publication uses the separate [Publish workflow](https://github.com/j4ckwinter/pancake-ui/actions/workflows/publish.yml). It publishes the exact archive from a successful main-branch Verify run, without rebuilding or repacking. The source revision must still be the current main revision. The workflow validates the source run, archive checksum, contents, package identity, version, MIT license, and public npm destination before publication.
|
|
136
|
+
|
|
137
|
+
The first release needs an npm account with access to the `@jack.winter` scope. Bootstrap the package once by authenticating to npm and publishing the reviewed, verified archive; never commit credentials. Configure the package’s npm trusted publisher for GitHub Actions with owner `j4ckwinter`, repository `pancake-ui`, and workflow filename `publish.yml`. This workflow does not use a GitHub environment. Subsequent workflow publishes use OIDC and provenance, without a stored npm token. Complete the first workflow release within two days of creating the trusted publisher; npm expires configurations that have not completed their first publish. See [npm’s configuration expiry policy](https://docs.npmjs.com/trusted-publishers/#trusted-publisher-configuration-expiry).
|
|
138
|
+
|
|
139
|
+
After a new version has been merged and Verify has succeeded on current main, dispatch Publish on main using that Verify run’s numeric ID:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
gh workflow run publish.yml --repo j4ckwinter/pancake-ui --ref main -f verify_run_id=RUN_ID
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Review the Publish result and confirm the registry version before telling consumers it is available. Published versions are immutable: make a new version and verify it again for any correction. To migrate an older local consumer, remove its `pancake-ui` dependency, install `@jack.winter/pancake-ui`, and update JavaScript and CSS imports to the scoped name. The component API is unchanged.
|
package/docs/styling.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Component styling
|
|
2
|
+
|
|
3
|
+
Pancake UI uses shared tokens and namespaced component styles. New components should fit the existing spacing, typography, and interaction patterns. These rules apply to the library's defaults; applications can still override `style`, `className`, and theme variables.
|
|
4
|
+
|
|
5
|
+
## Source organisation
|
|
6
|
+
|
|
7
|
+
- `src/components/<component-or-family>/`: one public component per matching TSX file, with adjacent props, private helpers and component/family CSS. Small shared implementation modules use explicit filenames such as `layout.shared.ts`.
|
|
8
|
+
- `src/foundations/`: tokens, generated theme CSS and font declarations.
|
|
9
|
+
- `src/stories/`: catalogue/foundation stories, the comparison page, and contract fixtures. Form fixtures own shared submission/reset state; feedback and presentation fixtures own their separate responsibilities.
|
|
10
|
+
- `src/index.ts`: the only public barrel. `src/styles.css`: the compiled stylesheet entry. Public package imports stay unchanged.
|
|
11
|
+
- `scripts/style/`: styling policy, exact exceptions, theme data, and AST resolution helpers. `scripts/style-css.mjs` and `scripts/style-tsx.mjs` remain the checker entry points.
|
|
12
|
+
|
|
13
|
+
`npm run check:structure` enforces source placement, one public component per TSX file, and dependency direction. Runtime code cannot depend on stories, tests, examples, or the public barrel; foundations cannot depend on components. ESLint limits runtime source files to 180 nonblank, noncomment lines. This is a backstop for review, not a reason to scatter one coherent operation across tiny helpers. Stories and declarative token/policy tables are not subject to that runtime limit.
|
|
14
|
+
|
|
15
|
+
`npm run test:structure` proves those rules reject representative violations. Both commands run in `verify`. Reorganisations must preserve exports, CSS order, story IDs and screenshot baselines; do not regenerate images to accommodate a file move.
|
|
16
|
+
|
|
17
|
+
## Choose values by their role
|
|
18
|
+
|
|
19
|
+
- Use `src/foundations/tokens.ts` as the source of design values and CSS variables in component styles. Run `npm run tokens` after changing tokens. Do not edit the generated `src/foundations/theme.css`.
|
|
20
|
+
- Use 4px for supporting-text spacing, 8px between labels and controls, 16px for ordinary vertical composition, and 24px for surface padding. Use `Stack`, `Inline`, and `Text` when composing components. Choose another existing spacing token when the composition calls for it.
|
|
21
|
+
- Preserve component-family sizing: buttons use 40px or 48px minimum heights, fields (including Select) 52px, segments 48px, checkboxes 40px, and notification dismiss targets 44px. These are current defaults, not a requirement to force every control to one height. New families need an explicit sizing choice in review.
|
|
22
|
+
- Numeric and temporal TextField modes retain native browser controls within the 52px field family. FileField uses the same field shell and native file selector, with token-based button padding and typography.
|
|
23
|
+
- Textarea uses the field styles with four native text rows by default and vertical resizing; Select retains native selection with a decorative chevron and a 52px minimum height.
|
|
24
|
+
- Table uses body typography, 16px cell padding and a 112px minimum cell content width inside a keyboard-scrollable wrapper. This keeps embedded controls and status labels readable; narrow layouts scroll instead of compressing columns into letter fragments. Pagination uses the 40px button family, 8px gaps, wrapping and shared current/focus states.
|
|
25
|
+
- Tooltip reuses native Popover anchoring with body typography, 8px padding and an 8px radius. Its trigger retains the original component styling.
|
|
26
|
+
- DropdownMenu reuses Popover anchoring, with 8px panel padding, 40px minimum item heights and shared focus/disabled tokens. Long labels wrap within the panel.
|
|
27
|
+
- Popover uses a 320px width token, 24px padding, 16px radius and 8px anchor spacing. Native CSS anchor positioning chooses the side with more room; viewport constraints and overflow scrolling keep long content reachable.
|
|
28
|
+
- Dialog uses a 560px maximum-width sizing token, 24px surface padding, 16px radius, and a dedicated 50% backdrop-opacity token. Viewport margins and scrolling keep content reachable on narrow screens.
|
|
29
|
+
- RadioGroup uses 24px styled native radio inputs within 40px rows. Its outline applies on focus, including pointer focus, to retain a visible indicator during WebKit native arrow navigation. Switch uses a 64px by 40px track and a 24px thumb, with the existing focus and disabled tokens.
|
|
30
|
+
- Progress retains the native browser bar at a 16px height with a deep accent and an 8px label gap. LoadingIndicator uses static 4px decorative dots, body typography and an 8px text gap; status feedback does not depend on animation.
|
|
31
|
+
- Tabs use 48px minimum button heights and the shared focus/selection tokens. Disclosure uses a native summary marker, 16px padding and the surface radius.
|
|
32
|
+
- Choose a typography role instead of assigning separate font metrics. The type scale uses proportional line heights; it is not a four-point baseline grid.
|
|
33
|
+
- Use existing radius roles: pill shapes for buttons and chips, 12px for fields, and 16px for surfaces. Other established components can use their existing radius tokens.
|
|
34
|
+
- Form controls and Disclosure use the olive `controlFocus` outline; other focus outlines use `deep`. Both use 2px width. Buttons and checkboxes use a 4px offset; other existing interactive controls use 2px. The lime `focusRing` token currently accents the focused input border, not its outline.
|
|
35
|
+
- Disabled controls use the shared disabled opacity. Preserve native disabled behaviour and visible keyboard focus.
|
|
36
|
+
|
|
37
|
+
These defaults preserve the current appearance. Changing them is a design change and should include before/after visual review.
|
|
38
|
+
|
|
39
|
+
## Automated checks
|
|
40
|
+
|
|
41
|
+
Run `npm run check:styles` for source checks, or `npm run verify` for the full suite. Verification also runs the guardrail tests and checks that generated theme CSS is current before the build can regenerate it.
|
|
42
|
+
|
|
43
|
+
The source checks inspect library CSS and JavaScript/TypeScript beneath `src`, including nested directories. Everything under `src/stories`, the example application, token definitions, font declarations, and generated theme CSS are outside the component-style checks. Theme freshness is checked separately.
|
|
44
|
+
|
|
45
|
+
Component CSS belongs in `@layer components`. Selectors must remain scoped to `pancake-` classes. Use declared theme variables and supported namespaced Tailwind utilities instead of introducing raw colours, dimensions, typography, or opacity. Library-authored inline styles must follow the same token discipline; passing consumer styles through remains supported.
|
|
46
|
+
|
|
47
|
+
The checker has narrow, reviewed exceptions for existing accessibility geometry, forced-colour styles, responsive layout thresholds, and optical adjustments. Do not add a blanket exemption for a new component. When a value cannot reasonably use a shared token, add a specific exception with its reason and a test. Reusing a number is not, by itself, a reason to create a new design token.
|
|
48
|
+
|
|
49
|
+
The CSS checker supports explicit selectors and a defined set of token utilities; CSS nesting and `:is()`/`:where()` selectors are deliberately rejected. Add component styles through local CSS imports in `src/styles.css`.
|
|
50
|
+
|
|
51
|
+
The checks are static guardrails, not a general evaluator of arbitrary JavaScript or CSS. The TypeScript check follows local style objects and props bags, but does not trace arbitrary function calls or aliases of `createElement`. Prefer straightforward token-based styles that can be inspected. An unsupported expression should be simplified or explicitly supported by the checker with regression coverage.
|
|
52
|
+
|
|
53
|
+
See [verification and behaviour contracts](verification.md) for required interaction coverage, accessibility states, type checks, and compatibility tests.
|
|
54
|
+
|
|
55
|
+
## Review a new component
|
|
56
|
+
|
|
57
|
+
Show the component alongside existing components in Storybook. Check its default, focus, disabled, error, and loading states where applicable, with long content and a narrow viewport. Use the library styles without example-app global heading or paragraph overrides when judging the defaults.
|
|
58
|
+
|
|
59
|
+
Check whether related elements have consistent spacing and whether the component fits the established typography and control sizes. Automated checks can reject an arbitrary `13px` padding value; they cannot decide whether 12px or 16px is the better choice. The `Foundations/Comparison` story is the visual reference. It imports only library components and bundled fonts, without the example app’s styles. It covers default, disabled, loading, error, and long-content states. Browser tests capture the catalogue and focused actions/fields at 1100px and 375px viewport widths.
|
|
60
|
+
|
|
61
|
+
`npm run check:comparison` discovers public uppercase callable or constructable exports through `src/index.ts` and requires actual JSX usage imported through that entry point in `src/stories/comparison/Comparison.stories.tsx`. Add a `data-component="ExportName"` marker to the rendered component or its wrapper so the browser test also verifies it is visible. Imports alone do not count. Function and class components are covered, including components authored with `createElement` in `.ts` files. Reserve uppercase callable exports for components; other component representations require extending this check before exporting them.
|
|
62
|
+
|
|
63
|
+
## Screenshot regression workflow
|
|
64
|
+
|
|
65
|
+
`npm run verify` runs coverage checks and screenshot comparisons alongside the existing browser tests. Missing baselines and visual differences fail; ordinary verification never creates or updates a baseline.
|
|
66
|
+
|
|
67
|
+
To inspect the story, run `npm run storybook` and open **Foundations → Comparison → Catalogue**. To run only the visual checks after building Storybook:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
npm run storybook:build
|
|
71
|
+
npm run test:visual
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For an intentional visual change, update the snapshots explicitly:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
npm run test:visual:update
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Inspect every changed image in `tests/visual.spec.ts-snapshots/` and review the Storybook composition before committing those images with the component change. Do not regenerate snapshots simply to make CI pass. Failures put expected, actual, and diff images in `test-results/`; CI uploads that directory.
|
|
81
|
+
|
|
82
|
+
The checked-in baselines were generated with the locked Playwright Chromium on macOS 27 ARM64, using bundled Inter fonts. The visual project pins `en-GB` locale for native date/time and file-control labels. CI uses GitHub’s [`xcode-27` macOS ARM64 runner](https://docs.github.com/en/actions/reference/runners/github-hosted-runners). [Playwright snapshots vary by operating system](https://playwright.dev/docs/test-snapshots), so Linux and Windows need separately generated and reviewed baselines; no platform is silently skipped. Hosted CI has not yet been exercised for these initial baselines, and even macOS runner updates can require reviewing rendering differences. Keep the browser dependency pinned and use the same environment when updating snapshots.
|
|
83
|
+
|
|
84
|
+
The workspace registers `@apply` and `@theme` through `.vscode/tailwind.css-data.json` for VS Code-compatible CSS validation. Unknown at-rule diagnostics remain enabled. Reload the editor window if it has not picked up `.vscode/settings.json`.
|
|
85
|
+
|
|
86
|
+
### Borders and navigation spacing
|
|
87
|
+
|
|
88
|
+
Use soft fills for button hover and the border token for decorative panel edges and table dividers. Selected tabs and segments use a label underline as well as a fill, keeping selection distinct from keyboard focus even in forced colours. Preserve focus outlines and form-control boundaries.
|
|
89
|
+
|
|
90
|
+
Bottom navigation sizes to its contents: 8px list padding surrounds links with a minimum 48px target height. Links fill their row when icons or wrapping labels make neighbouring items taller; do not add a fixed list minimum height.
|
|
91
|
+
|
|
92
|
+
Form controls share the olive `controlBorder` token for their default boundaries. Keep it distinct from the faint decorative `border` token. Invalid fields use `errorStrong` with the existing thicker border and error message. Checkbox, radio and switch selection retains a checkmark, dot or thumb position as well as the lime fill; forced-colour mode restores native rendering.
|