@allxsmith/bestax-bulma 5.18.2 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/constants.cjs +67 -6
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +30 -6
- package/dist/constants.esm.js +65 -7
- package/dist/constants.esm.js.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +598 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +596 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Card.d.ts +2 -0
- package/dist/types/components/Carousel.d.ts +8 -2
- package/dist/types/components/Modal.d.ts +2 -0
- package/dist/types/components/Navbar.d.ts +24 -3
- package/dist/types/components/Sidebar.d.ts +2 -0
- package/dist/types/components/Steps.d.ts +5 -1
- package/dist/types/elements/Delete.d.ts +9 -1
- package/dist/types/elements/Link.d.ts +7 -1
- package/dist/types/elements/Notification.d.ts +29 -3
- package/dist/types/elements/Tag.d.ts +7 -1
- package/dist/types/elements/Td.d.ts +21 -2
- package/dist/types/form/DateInputBase.d.ts +9 -1
- package/dist/types/form/DateTimeInputBase.d.ts +11 -4
- package/dist/types/form/TimeInputBase.d.ts +4 -2
- package/dist/types/helpers/Theme.d.ts +6 -1
- package/dist/types/helpers/bulmaClassHelpers.d.ts +30 -6
- package/dist/types/helpers/shadowDom.d.ts +54 -0
- package/dist/types/helpers/statusRegion.d.ts +61 -0
- package/dist/types/helpers/useBulmaClasses.d.ts +1 -1
- package/dist/types/helpers/useOtherClasses.d.ts +61 -5
- package/dist/types-cjs/components/Card.d.ts +2 -0
- package/dist/types-cjs/components/Carousel.d.ts +8 -2
- package/dist/types-cjs/components/Modal.d.ts +2 -0
- package/dist/types-cjs/components/Navbar.d.ts +24 -3
- package/dist/types-cjs/components/Sidebar.d.ts +2 -0
- package/dist/types-cjs/components/Steps.d.ts +5 -1
- package/dist/types-cjs/elements/Delete.d.ts +9 -1
- package/dist/types-cjs/elements/Link.d.ts +7 -1
- package/dist/types-cjs/elements/Notification.d.ts +29 -3
- package/dist/types-cjs/elements/Tag.d.ts +7 -1
- package/dist/types-cjs/elements/Td.d.ts +21 -2
- package/dist/types-cjs/form/DateInputBase.d.ts +9 -1
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +11 -4
- package/dist/types-cjs/form/TimeInputBase.d.ts +4 -2
- package/dist/types-cjs/helpers/Theme.d.ts +6 -1
- package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +30 -6
- package/dist/types-cjs/helpers/shadowDom.d.ts +54 -0
- package/dist/types-cjs/helpers/statusRegion.d.ts +61 -0
- package/dist/types-cjs/helpers/useBulmaClasses.d.ts +1 -1
- package/dist/types-cjs/helpers/useOtherClasses.d.ts +61 -5
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/form/_dateinput.scss +36 -10
- package/src/scss/form/_timeinput.scss +30 -9
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow classes.\n * @example 'clipped'\n */\nexport const validOverflows = ['clipped'] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper classes.\n * @example 'radiusless'\n */\nexport const validRadii = ['radiusless'] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AACI,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,MAAM;;AAGR;;;AAGG;AACI,MAAM,gBAAgB,GAAG;IAC9B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,MAAM;IACN,MAAM;IACN,MAAM;IACN,WAAW;;AAGb;;;;;;;AAOG;AACI,MAAM,iBAAiB,GAAG;IAC/B,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,mBAAmB;IACnB,mBAAmB;;AAGrB;;;AAGG;MACU,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GA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AAyB,EACzB,WAA8B,EAC9B,gBAAgB,GAAG,KAAK,EACxB,kBAAA,GAAwC,cAAc,KACpD;QACF,IAAI,KAAK,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACxC,MAAM,SAAS,GACb,gBAAgB;gBAChB,QAAQ;AACR,gBAAA,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACjC,gBAAA,kBAAkB,CAAC,QAAQ,CAAC,QAAQ;AAClC,kBAAE,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAA,EAAI,QAAQ,CAAA;AAChC,kBAAE,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,KAAK,EAAE;YAC1B,gBAAgB,CAAC,SAAS,CAAC;QAC7B;AACF,IAAA,CAAC;;IAGD,MAAM,kBAAkB,GAAG,CACzB,MAAc,EACd,KAAyB,EACzB,WAA8B,KAC5B;AACF,QAAA,IAAI,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,YAAA,gBAAgB,CAAC,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAE,CAAC;QACxC;AACF,IAAA,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;AACpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow values for one axis, taken by `overflowX` and\n * `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.\n * @example 'auto', 'hidden', 'scroll'\n */\nexport const validAxisOverflows = [\n 'auto',\n 'clip',\n 'hidden',\n 'scroll',\n 'visible',\n] as const;\n\n/**\n * Valid Bulma overflow values for `overflow`.\n *\n * `clipped` renders `is-clipped`, the helper `overflow` started with. Every\n * other value renders `is-overflow-<value>`.\n * @example 'clipped', 'auto', 'hidden'\n */\nexport const validOverflows = ['clipped', ...validAxisOverflows] as const;\n\n/**\n * Valid Bulma position values, taken by `pos`. Each renders\n * `is-position-<value>`.\n * @example 'relative', 'absolute', 'sticky'\n */\nexport const validPositions = [\n 'absolute',\n 'fixed',\n 'relative',\n 'static',\n 'sticky',\n] as const;\n\n/**\n * Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders\n * `is-aspect-ratio-<value>`.\n * @example '1by1', '4by3', '16by9'\n */\nexport const validAspectRatios = [\n '1by1',\n '5by4',\n '4by3',\n '3by2',\n '5by3',\n '16by9',\n '2by1',\n '3by1',\n '4by5',\n '3by4',\n '2by3',\n '3by5',\n '9by16',\n '1by2',\n '1by3',\n] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper values.\n *\n * `radiusless` renders `is-radiusless` and removes the radius. The sizes\n * render `has-radius-<value>` and set one from Bulma's radius scale.\n * @example 'radiusless', 'small', 'rounded'\n */\nexport const validRadii = [\n 'radiusless',\n 'small',\n 'normal',\n 'large',\n 'rounded',\n] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":[],"mappings":";;;AAAA;;;AAGG;AACI,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IAC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B,WAA8B,EAC9B,gBAAgB,GAAG,KAAK,EACxB,kBAAA,GAAwC,cAAc,KACpD;QACF,IAAI,KAAK,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACxC,MAAM,SAAS,GACb,gBAAgB;gBAChB,QAAQ;AACR,gBAAA,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACjC,gBAAA,kBAAkB,CAAC,QAAQ,CAAC,QAAQ;AAClC,kBAAE,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAA,EAAI,QAAQ,CAAA;AAChC,kBAAE,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,KAAK,EAAE;YAC1B,gBAAgB,CAAC,SAAS,CAAC;QAC7B;AACF,IAAA,CAAC;;IAGD,MAAM,kBAAkB,GAAG,CACzB,MAAc,EACd,KAAyB,EACzB,WAA8B,KAC5B;AACF,QAAA,IAAI,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,YAAA,gBAAgB,CAAC,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAE,CAAC;QACxC;AACF,IAAA,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;AACpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/constants.d.cts
CHANGED
|
@@ -104,10 +104,31 @@ export declare const validViewports: readonly ["mobile", "tablet", "tablet-only"
|
|
|
104
104
|
*/
|
|
105
105
|
export declare const validFloats: readonly ["left", "right"];
|
|
106
106
|
/**
|
|
107
|
-
* Valid Bulma overflow
|
|
108
|
-
*
|
|
107
|
+
* Valid Bulma overflow values for one axis, taken by `overflowX` and
|
|
108
|
+
* `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.
|
|
109
|
+
* @example 'auto', 'hidden', 'scroll'
|
|
109
110
|
*/
|
|
110
|
-
export declare const
|
|
111
|
+
export declare const validAxisOverflows: readonly ["auto", "clip", "hidden", "scroll", "visible"];
|
|
112
|
+
/**
|
|
113
|
+
* Valid Bulma overflow values for `overflow`.
|
|
114
|
+
*
|
|
115
|
+
* `clipped` renders `is-clipped`, the helper `overflow` started with. Every
|
|
116
|
+
* other value renders `is-overflow-<value>`.
|
|
117
|
+
* @example 'clipped', 'auto', 'hidden'
|
|
118
|
+
*/
|
|
119
|
+
export declare const validOverflows: readonly ["clipped", "auto", "clip", "hidden", "scroll", "visible"];
|
|
120
|
+
/**
|
|
121
|
+
* Valid Bulma position values, taken by `pos`. Each renders
|
|
122
|
+
* `is-position-<value>`.
|
|
123
|
+
* @example 'relative', 'absolute', 'sticky'
|
|
124
|
+
*/
|
|
125
|
+
export declare const validPositions: readonly ["absolute", "fixed", "relative", "static", "sticky"];
|
|
126
|
+
/**
|
|
127
|
+
* Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders
|
|
128
|
+
* `is-aspect-ratio-<value>`.
|
|
129
|
+
* @example '1by1', '4by3', '16by9'
|
|
130
|
+
*/
|
|
131
|
+
export declare const validAspectRatios: readonly ["1by1", "5by4", "4by3", "3by2", "5by3", "16by9", "2by1", "3by1", "4by5", "3by4", "2by3", "3by5", "9by16", "1by2", "1by3"];
|
|
111
132
|
/**
|
|
112
133
|
* Valid Bulma interaction classes.
|
|
113
134
|
* @example 'unselectable', 'clickable'
|
|
@@ -132,10 +153,13 @@ export declare const validCursors: readonly ["pointer", "help"];
|
|
|
132
153
|
*/
|
|
133
154
|
export declare const cursorClasses: Record<(typeof validCursors)[number], string>;
|
|
134
155
|
/**
|
|
135
|
-
* Valid Bulma border-radius helper
|
|
136
|
-
*
|
|
156
|
+
* Valid Bulma border-radius helper values.
|
|
157
|
+
*
|
|
158
|
+
* `radiusless` renders `is-radiusless` and removes the radius. The sizes
|
|
159
|
+
* render `has-radius-<value>` and set one from Bulma's radius scale.
|
|
160
|
+
* @example 'radiusless', 'small', 'rounded'
|
|
137
161
|
*/
|
|
138
|
-
export declare const validRadii: readonly ["radiusless"];
|
|
162
|
+
export declare const validRadii: readonly ["radiusless", "small", "normal", "large", "rounded"];
|
|
139
163
|
/**
|
|
140
164
|
* Valid Bulma shadow helper classes.
|
|
141
165
|
* @example 'shadowless'
|
package/dist/constants.esm.js
CHANGED
|
@@ -237,10 +237,59 @@ const validViewports = [
|
|
|
237
237
|
*/
|
|
238
238
|
const validFloats = ['left', 'right'];
|
|
239
239
|
/**
|
|
240
|
-
* Valid Bulma overflow
|
|
241
|
-
*
|
|
240
|
+
* Valid Bulma overflow values for one axis, taken by `overflowX` and
|
|
241
|
+
* `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.
|
|
242
|
+
* @example 'auto', 'hidden', 'scroll'
|
|
242
243
|
*/
|
|
243
|
-
const
|
|
244
|
+
const validAxisOverflows = [
|
|
245
|
+
'auto',
|
|
246
|
+
'clip',
|
|
247
|
+
'hidden',
|
|
248
|
+
'scroll',
|
|
249
|
+
'visible',
|
|
250
|
+
];
|
|
251
|
+
/**
|
|
252
|
+
* Valid Bulma overflow values for `overflow`.
|
|
253
|
+
*
|
|
254
|
+
* `clipped` renders `is-clipped`, the helper `overflow` started with. Every
|
|
255
|
+
* other value renders `is-overflow-<value>`.
|
|
256
|
+
* @example 'clipped', 'auto', 'hidden'
|
|
257
|
+
*/
|
|
258
|
+
const validOverflows = ['clipped', ...validAxisOverflows];
|
|
259
|
+
/**
|
|
260
|
+
* Valid Bulma position values, taken by `pos`. Each renders
|
|
261
|
+
* `is-position-<value>`.
|
|
262
|
+
* @example 'relative', 'absolute', 'sticky'
|
|
263
|
+
*/
|
|
264
|
+
const validPositions = [
|
|
265
|
+
'absolute',
|
|
266
|
+
'fixed',
|
|
267
|
+
'relative',
|
|
268
|
+
'static',
|
|
269
|
+
'sticky',
|
|
270
|
+
];
|
|
271
|
+
/**
|
|
272
|
+
* Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders
|
|
273
|
+
* `is-aspect-ratio-<value>`.
|
|
274
|
+
* @example '1by1', '4by3', '16by9'
|
|
275
|
+
*/
|
|
276
|
+
const validAspectRatios = [
|
|
277
|
+
'1by1',
|
|
278
|
+
'5by4',
|
|
279
|
+
'4by3',
|
|
280
|
+
'3by2',
|
|
281
|
+
'5by3',
|
|
282
|
+
'16by9',
|
|
283
|
+
'2by1',
|
|
284
|
+
'3by1',
|
|
285
|
+
'4by5',
|
|
286
|
+
'3by4',
|
|
287
|
+
'2by3',
|
|
288
|
+
'3by5',
|
|
289
|
+
'9by16',
|
|
290
|
+
'1by2',
|
|
291
|
+
'1by3',
|
|
292
|
+
];
|
|
244
293
|
/**
|
|
245
294
|
* Valid Bulma interaction classes.
|
|
246
295
|
* @example 'unselectable', 'clickable'
|
|
@@ -268,10 +317,19 @@ const cursorClasses = {
|
|
|
268
317
|
help: 'is-cursor-help',
|
|
269
318
|
};
|
|
270
319
|
/**
|
|
271
|
-
* Valid Bulma border-radius helper
|
|
272
|
-
*
|
|
320
|
+
* Valid Bulma border-radius helper values.
|
|
321
|
+
*
|
|
322
|
+
* `radiusless` renders `is-radiusless` and removes the radius. The sizes
|
|
323
|
+
* render `has-radius-<value>` and set one from Bulma's radius scale.
|
|
324
|
+
* @example 'radiusless', 'small', 'rounded'
|
|
273
325
|
*/
|
|
274
|
-
const validRadii = [
|
|
326
|
+
const validRadii = [
|
|
327
|
+
'radiusless',
|
|
328
|
+
'small',
|
|
329
|
+
'normal',
|
|
330
|
+
'large',
|
|
331
|
+
'rounded',
|
|
332
|
+
];
|
|
275
333
|
/**
|
|
276
334
|
* Valid Bulma shadow helper classes.
|
|
277
335
|
* @example 'shadowless'
|
|
@@ -324,5 +382,5 @@ const createBulmaClassHelpers = (classPrefix, viewport) => {
|
|
|
324
382
|
return { classes, addPrefixedClass, addClass, addClassNoViewport };
|
|
325
383
|
};
|
|
326
384
|
|
|
327
|
-
export { createBulmaClassHelpers, cursorClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments, validColorShades, validColors, validCursors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFloats, validFontFamilies, validInteractions, validJustifyContents, validOverflows, validRadii, validResponsives, validSchemeColors, validShadows, validSizes, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
|
|
385
|
+
export { createBulmaClassHelpers, cursorClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments, validAspectRatios, validAxisOverflows, validColorShades, validColors, validCursors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFloats, validFontFamilies, validInteractions, validJustifyContents, validOverflows, validPositions, validRadii, validResponsives, validSchemeColors, validShadows, validSizes, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
|
|
328
386
|
//# sourceMappingURL=constants.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.esm.js","sources":["../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow classes.\n * @example 'clipped'\n */\nexport const validOverflows = ['clipped'] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper classes.\n * @example 'radiusless'\n */\nexport const validRadii = ['radiusless'] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":[],"mappings":";AAAA;;;AAGG;AACI,MAAM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,EAAE;YAC1B,gBAAgB,CAAC,SAAS,CAAC;QAC7B;AACF,IAAA,CAAC;;IAGD,MAAM,kBAAkB,GAAG,CACzB,MAAc,EACd,KAAyB,EACzB,WAA8B,KAC5B;AACF,QAAA,IAAI,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,YAAA,gBAAgB,CAAC,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAE,CAAC;QACxC;AACF,IAAA,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;AACpE;;"}
|
|
1
|
+
{"version":3,"file":"constants.esm.js","sources":["../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow values for one axis, taken by `overflowX` and\n * `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.\n * @example 'auto', 'hidden', 'scroll'\n */\nexport const validAxisOverflows = [\n 'auto',\n 'clip',\n 'hidden',\n 'scroll',\n 'visible',\n] as const;\n\n/**\n * Valid Bulma overflow values for `overflow`.\n *\n * `clipped` renders `is-clipped`, the helper `overflow` started with. Every\n * other value renders `is-overflow-<value>`.\n * @example 'clipped', 'auto', 'hidden'\n */\nexport const validOverflows = ['clipped', ...validAxisOverflows] as const;\n\n/**\n * Valid Bulma position values, taken by `pos`. Each renders\n * `is-position-<value>`.\n * @example 'relative', 'absolute', 'sticky'\n */\nexport const validPositions = [\n 'absolute',\n 'fixed',\n 'relative',\n 'static',\n 'sticky',\n] as const;\n\n/**\n * Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders\n * `is-aspect-ratio-<value>`.\n * @example '1by1', '4by3', '16by9'\n */\nexport const validAspectRatios = [\n '1by1',\n '5by4',\n '4by3',\n '3by2',\n '5by3',\n '16by9',\n '2by1',\n '3by1',\n '4by5',\n '3by4',\n '2by3',\n '3by5',\n '9by16',\n '1by2',\n '1by3',\n] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper values.\n *\n * `radiusless` renders `is-radiusless` and removes the radius. The sizes\n * render `has-radius-<value>` and set one from Bulma's radius scale.\n * @example 'radiusless', 'small', 'rounded'\n */\nexport const validRadii = [\n 'radiusless',\n 'small',\n 'normal',\n 'large',\n 'rounded',\n] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":[],"mappings":";AAAA;;;AAGG;AACI,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,MAAM;;AAGR;;;AAGG;AACI,MAAM,gBAAgB,GAAG;IAC9B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,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