@allxsmith/bestax-bulma 5.58.0 → 5.60.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.
Files changed (82) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Affix.js +46 -0
  4. package/dist/esm/components/Affix.js.map +1 -0
  5. package/dist/esm/components/Dialog.js +2 -6
  6. package/dist/esm/components/Dialog.js.map +1 -1
  7. package/dist/esm/components/Modal.js +12 -24
  8. package/dist/esm/components/Modal.js.map +1 -1
  9. package/dist/esm/elements/Buttons.js +2 -0
  10. package/dist/esm/elements/Buttons.js.map +1 -1
  11. package/dist/esm/elements/IconButton.js +114 -0
  12. package/dist/esm/elements/IconButton.js.map +1 -0
  13. package/dist/esm/helpers/containerBreakpoints.js +14 -0
  14. package/dist/esm/helpers/containerBreakpoints.js.map +1 -0
  15. package/dist/esm/helpers/polymorphic.js.map +1 -1
  16. package/dist/esm/helpers/portal.js +28 -1
  17. package/dist/esm/helpers/portal.js.map +1 -1
  18. package/dist/esm/helpers/stackLayout.js +30 -0
  19. package/dist/esm/helpers/stackLayout.js.map +1 -0
  20. package/dist/esm/helpers/useBulmaClasses.js +8 -2
  21. package/dist/esm/helpers/useBulmaClasses.js.map +1 -1
  22. package/dist/esm/helpers/useFlexboxClasses.js +17 -4
  23. package/dist/esm/helpers/useFlexboxClasses.js.map +1 -1
  24. package/dist/esm/layout/Center.js +33 -0
  25. package/dist/esm/layout/Center.js.map +1 -0
  26. package/dist/esm/layout/Container.js +2 -6
  27. package/dist/esm/layout/Container.js.map +1 -1
  28. package/dist/esm/layout/Flex.js +34 -0
  29. package/dist/esm/layout/Flex.js.map +1 -0
  30. package/dist/esm/layout/Group.js +43 -0
  31. package/dist/esm/layout/Group.js.map +1 -0
  32. package/dist/esm/layout/Stack.js +34 -0
  33. package/dist/esm/layout/Stack.js.map +1 -0
  34. package/dist/extras.css +1 -1
  35. package/dist/extras.css.map +1 -1
  36. package/dist/index.cjs +476 -160
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.esm.js +6 -0
  39. package/dist/index.esm.js.map +1 -1
  40. package/dist/types/components/Affix.d.ts +67 -0
  41. package/dist/types/elements/Buttons.d.ts +1 -0
  42. package/dist/types/elements/IconButton.d.ts +110 -0
  43. package/dist/types/helpers/containerBreakpoints.d.ts +2 -0
  44. package/dist/types/helpers/polymorphic.d.ts +19 -0
  45. package/dist/types/helpers/portal.d.ts +42 -0
  46. package/dist/types/helpers/stackLayout.d.ts +62 -0
  47. package/dist/types/helpers/useBulmaClasses.d.ts +8 -2
  48. package/dist/types/helpers/useFlexboxClasses.d.ts +26 -3
  49. package/dist/types/index.d.ts +8 -1
  50. package/dist/types/layout/Center.d.ts +54 -0
  51. package/dist/types/layout/Flex.d.ts +92 -0
  52. package/dist/types/layout/Group.d.ts +86 -0
  53. package/dist/types/layout/Stack.d.ts +63 -0
  54. package/dist/types-cjs/components/Affix.d.ts +67 -0
  55. package/dist/types-cjs/elements/Buttons.d.ts +1 -0
  56. package/dist/types-cjs/elements/IconButton.d.ts +110 -0
  57. package/dist/types-cjs/helpers/containerBreakpoints.d.ts +2 -0
  58. package/dist/types-cjs/helpers/polymorphic.d.ts +19 -0
  59. package/dist/types-cjs/helpers/portal.d.ts +42 -0
  60. package/dist/types-cjs/helpers/stackLayout.d.ts +62 -0
  61. package/dist/types-cjs/helpers/useBulmaClasses.d.ts +8 -2
  62. package/dist/types-cjs/helpers/useFlexboxClasses.d.ts +26 -3
  63. package/dist/types-cjs/index.d.ts +8 -1
  64. package/dist/types-cjs/layout/Center.d.ts +54 -0
  65. package/dist/types-cjs/layout/Flex.d.ts +92 -0
  66. package/dist/types-cjs/layout/Group.d.ts +86 -0
  67. package/dist/types-cjs/layout/Stack.d.ts +63 -0
  68. package/dist/versions/bestax-no-dark-mode.css +1 -1
  69. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  70. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  71. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  72. package/dist/versions/bestax-no-helpers.css +1 -1
  73. package/dist/versions/bestax-no-helpers.css.map +1 -1
  74. package/dist/versions/bestax-prefixed.css +1 -1
  75. package/dist/versions/bestax-prefixed.css.map +1 -1
  76. package/package.json +1 -1
  77. package/src/scss/components/_affix.scss +74 -0
  78. package/src/scss/components/_index.scss +1 -0
  79. package/src/scss/elements/_iconbutton.scss +36 -0
  80. package/src/scss/elements/_index.scss +1 -0
  81. package/src/scss/layout/_index.scss +1 -0
  82. package/src/scss/layout/_stack.scss +145 -0
@@ -0,0 +1,92 @@
1
+ import React from 'react';
2
+ import type { ConstrainedPolymorphicComponent } from '../helpers/polymorphic.js';
3
+ import { type LayoutElement, type LayoutOwnProps } from '../helpers/stackLayout.js';
4
+ import type { BulmaGapStep, validAlignContents, validAlignItems, validFlexDirections, validFlexWraps, validJustifyContents } from '../helpers/useBulmaClasses.js';
5
+ /**
6
+ * The Flex component's own props, beside the attributes of the element `as`
7
+ * renders.
8
+ */
9
+ export interface FlexOwnProps extends LayoutOwnProps {
10
+ /**
11
+ * The main axis. `row-reverse` and `column-reverse` change only what's seen:
12
+ * reading and Tab order still follow the children's order (WCAG 1.3.2 and
13
+ * 2.4.3). Needs Bulma's helper classes: under `bestax-no-helpers.css` the
14
+ * default stays.
15
+ * @defaultValue 'row'
16
+ */
17
+ flexDirection?: (typeof validFlexDirections)[number];
18
+ /**
19
+ * Whether children move to a new line when they don't fit. Needs Bulma's
20
+ * helper classes: under `bestax-no-helpers.css` the default stays.
21
+ * @defaultValue 'nowrap'
22
+ */
23
+ flexWrap?: (typeof validFlexWraps)[number];
24
+ /**
25
+ * How each child sits across the main axis. Needs Bulma's helper classes:
26
+ * under `bestax-no-helpers.css` the default stays.
27
+ * @defaultValue 'stretch'
28
+ */
29
+ alignItems?: (typeof validAlignItems)[number];
30
+ /**
31
+ * Where the children sit along the main axis. Needs Bulma's helper classes:
32
+ * under `bestax-no-helpers.css` the default stays.
33
+ */
34
+ justifyContent?: (typeof validJustifyContents)[number];
35
+ /**
36
+ * How wrapped lines share the space across the main axis. Needs Bulma's
37
+ * helper classes: under `bestax-no-helpers.css` the default stays.
38
+ */
39
+ alignContent?: (typeof validAlignContents)[number];
40
+ /**
41
+ * Space between children, a step of Bulma's gap scale. None by default. Needs
42
+ * Bulma's helper classes: under `bestax-no-helpers.css` the default stays.
43
+ */
44
+ gap?: BulmaGapStep;
45
+ /**
46
+ * Space between wrapped lines, when it differs from `gap`. Needs Bulma's
47
+ * helper classes: under `bestax-no-helpers.css` the default stays.
48
+ */
49
+ rowGap?: BulmaGapStep;
50
+ /**
51
+ * Space between children along a row, when it differs from `gap`. Needs
52
+ * Bulma's helper classes: under `bestax-no-helpers.css` the default stays.
53
+ */
54
+ columnGap?: BulmaGapStep;
55
+ }
56
+ /**
57
+ * Props for the Flex component. The attributes and the `ref` follow `as`, so
58
+ * `as="form"` takes `action` and `as="fieldset"` takes `disabled`.
59
+ *
60
+ * @extraProp {PolymorphicRef<LayoutElement>} [ref] - Ref forwarded to the element `as` renders.
61
+ */
62
+ export type FlexProps<T extends LayoutElement = LayoutElement> = FlexOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof FlexOwnProps | 'as'> & {
63
+ /**
64
+ * The element to render. With `ul` or `ol`, give it `li` children: it
65
+ * restates `role="list"`, which Bulma's list reset takes away in Safari.
66
+ * @defaultValue 'div'
67
+ */
68
+ as?: T;
69
+ };
70
+ /**
71
+ * The `Flex` component is a flex container with CSS's own defaults, taking the flex container's properties as props.
72
+ *
73
+ * It's a row that doesn't wrap, with its children stretched across it and no
74
+ * gap, until you set otherwise. Use it for a layout of your own, such as a
75
+ * fixed side beside a growing one, with `flexGrow` and `flexShrink` on the
76
+ * children. Its children's own block margins are zeroed, so the gap is the
77
+ * only space. For a column of blocks or a row of controls with Bulma's
78
+ * spacing already in place, `Stack` and `Group` start closer.
79
+ *
80
+ * @function
81
+ * @param {FlexProps} props - Props for the Flex component.
82
+ * @param {React.Ref} ref - Forwarded ref to the element `as` renders.
83
+ * @returns {JSX.Element} The rendered flex container.
84
+ *
85
+ * @example
86
+ * <Flex gap="4" alignItems="flex-start">
87
+ * <Box flexShrink="0">…</Box>
88
+ * <Box flexGrow="1">…</Box>
89
+ * </Flex>
90
+ */
91
+ export declare const Flex: ConstrainedPolymorphicComponent<FlexOwnProps, LayoutElement, "div">;
92
+ export default Flex;
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import type { ConstrainedPolymorphicComponent } from '../helpers/polymorphic.js';
3
+ import { type LayoutElement, type LayoutOwnProps } from '../helpers/stackLayout.js';
4
+ import type { BulmaGapStep, validAlignItems, validFlexWraps, validJustifyContents } from '../helpers/useBulmaClasses.js';
5
+ import type { ContainerBreakpoint } from './Container.js';
6
+ /**
7
+ * The Group component's own props, beside the attributes of the element `as`
8
+ * renders.
9
+ */
10
+ export interface GroupOwnProps extends LayoutOwnProps {
11
+ /**
12
+ * Space between children, a step of Bulma's gap scale. Unset, it's
13
+ * `--bulma-stack-horizontal-gap`, half of Bulma's block spacing. Needs
14
+ * Bulma's helper classes: under `bestax-no-helpers.css` the default stays.
15
+ */
16
+ gap?: BulmaGapStep;
17
+ /**
18
+ * How each child sits across the row. While `breakpoint` stacks them, it's
19
+ * where each sits across the column. Needs Bulma's helper classes: under
20
+ * `bestax-no-helpers.css` the default stays.
21
+ * @defaultValue 'center'
22
+ */
23
+ alignItems?: (typeof validAlignItems)[number];
24
+ /**
25
+ * Where the children sit along the row: `'space-between'` pushes the ends
26
+ * apart. Needs Bulma's helper classes: under `bestax-no-helpers.css` the
27
+ * default stays.
28
+ */
29
+ justifyContent?: (typeof validJustifyContents)[number];
30
+ /**
31
+ * Whether children move to a new row when they don't fit. Needs Bulma's
32
+ * helper classes: under `bestax-no-helpers.css` the default stays.
33
+ * @defaultValue 'wrap'
34
+ */
35
+ flexWrap?: (typeof validFlexWraps)[number];
36
+ /**
37
+ * The children share the row equally, and fill the column while
38
+ * `breakpoint` stacks them (Bulma's `is-fullwidth`).
39
+ */
40
+ isFullwidth?: boolean;
41
+ /**
42
+ * Stacks the children below this Bulma breakpoint and sets them in a row
43
+ * from it up, the breakpoints Container's `breakpoint` takes. Unset, a row
44
+ * at every width. It's the job Columns and Level do with booleans:
45
+ * `'tablet'` is where they turn into a row by default, `'desktop'` is
46
+ * Columns' `isDesktop`, and leaving it unset is their `isMobile`.
47
+ */
48
+ breakpoint?: ContainerBreakpoint;
49
+ }
50
+ /**
51
+ * Props for the Group component. The attributes and the `ref` follow `as`, so
52
+ * `as="form"` takes `action` and `as="fieldset"` takes `disabled`.
53
+ *
54
+ * @extraProp {PolymorphicRef<LayoutElement>} [ref] - Ref forwarded to the element `as` renders.
55
+ */
56
+ export type GroupProps<T extends LayoutElement = LayoutElement> = GroupOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof GroupOwnProps | 'as'> & {
57
+ /**
58
+ * The element to render. With `ul` or `ol`, give it `li` children: it
59
+ * restates `role="list"`, which Bulma's list reset takes away in Safari.
60
+ * @defaultValue 'div'
61
+ */
62
+ as?: T;
63
+ };
64
+ /**
65
+ * The `Group` component lays its children out in a row that wraps, centered on each other, with half of Bulma's block spacing between them.
66
+ *
67
+ * Use it for a row of buttons, tags or avatars beside some text, or a toolbar
68
+ * with `justifyContent="space-between"` pushing its ends apart. The children's
69
+ * own block margins are zeroed, so the gap is the only space. With
70
+ * `breakpoint`, it's a column on narrow screens and a row from that
71
+ * breakpoint up. For controls joined into one, with no gap and shared
72
+ * borders, use `hasAddons` on Field or Buttons instead.
73
+ *
74
+ * @function
75
+ * @param {GroupProps} props - Props for the Group component.
76
+ * @param {React.Ref} ref - Forwarded ref to the element `as` renders.
77
+ * @returns {JSX.Element} The rendered group.
78
+ *
79
+ * @example
80
+ * <Group justifyContent="space-between">
81
+ * <Title as="h2" size="4">Invoices</Title>
82
+ * <Button color="primary">New invoice</Button>
83
+ * </Group>
84
+ */
85
+ export declare const Group: ConstrainedPolymorphicComponent<GroupOwnProps, LayoutElement, "div">;
86
+ export default Group;
@@ -0,0 +1,63 @@
1
+ import React from 'react';
2
+ import type { ConstrainedPolymorphicComponent } from '../helpers/polymorphic.js';
3
+ import { type LayoutElement, type LayoutOwnProps } from '../helpers/stackLayout.js';
4
+ import type { BulmaGapStep, validAlignItems, validJustifyContents } from '../helpers/useBulmaClasses.js';
5
+ /**
6
+ * The Stack component's own props, beside the attributes of the element `as`
7
+ * renders.
8
+ */
9
+ export interface StackOwnProps extends LayoutOwnProps {
10
+ /**
11
+ * Space between children, a step of Bulma's gap scale (`'2'` is 1rem). Unset,
12
+ * it's `--bulma-stack-gap`, Bulma's block spacing. Needs Bulma's helper
13
+ * classes: under `bestax-no-helpers.css` the default stays.
14
+ */
15
+ gap?: BulmaGapStep;
16
+ /**
17
+ * How each child sits across the column. `'stretch'` makes each as wide as
18
+ * the Stack. Needs Bulma's helper classes: under `bestax-no-helpers.css` the
19
+ * default stays.
20
+ * @defaultValue 'stretch'
21
+ */
22
+ alignItems?: (typeof validAlignItems)[number];
23
+ /**
24
+ * Where the children sit down the column, when it's taller than they are.
25
+ * Needs Bulma's helper classes: under `bestax-no-helpers.css` the default
26
+ * stays.
27
+ */
28
+ justifyContent?: (typeof validJustifyContents)[number];
29
+ }
30
+ /**
31
+ * Props for the Stack component. The attributes and the `ref` follow `as`, so
32
+ * `as="form"` takes `action` and `as="fieldset"` takes `disabled`.
33
+ *
34
+ * @extraProp {PolymorphicRef<LayoutElement>} [ref] - Ref forwarded to the element `as` renders.
35
+ */
36
+ export type StackProps<T extends LayoutElement = LayoutElement> = StackOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof StackOwnProps | 'as'> & {
37
+ /**
38
+ * The element to render. With `ul` or `ol`, give it `li` children: it
39
+ * restates `role="list"`, which Bulma's list reset takes away in Safari.
40
+ * @defaultValue 'div'
41
+ */
42
+ as?: T;
43
+ };
44
+ /**
45
+ * The `Stack` component lays its children out in a column, with Bulma's block spacing between them and the margins Bulma gives them zeroed.
46
+ *
47
+ * A Stack of Boxes, Cards or Notifications looks like Bulma's own stacked
48
+ * blocks, spaced by the gap alone, so there are no margins to undo. A `gap`
49
+ * step replaces the default spacing. It's always a column, top to bottom.
50
+ *
51
+ * @function
52
+ * @param {StackProps} props - Props for the Stack component.
53
+ * @param {React.Ref} ref - Forwarded ref to the element `as` renders.
54
+ * @returns {JSX.Element} The rendered stack.
55
+ *
56
+ * @example
57
+ * <Stack>
58
+ * <Notification color="info">Your changes are saved.</Notification>
59
+ * <Box>…</Box>
60
+ * </Stack>
61
+ */
62
+ export declare const Stack: ConstrainedPolymorphicComponent<StackOwnProps, LayoutElement, "div">;
63
+ export default Stack;