@blueprintjs/labs 0.16.3 → 6.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.
Files changed (147) hide show
  1. package/LICENSE +153 -167
  2. package/README.md +1 -1
  3. package/lib/cjs/common/classes.d.ts +6 -0
  4. package/lib/cjs/common/classes.js +20 -0
  5. package/lib/cjs/common/classes.js.map +1 -0
  6. package/lib/cjs/common/index.d.ts +3 -1
  7. package/lib/cjs/common/index.js +9 -4
  8. package/lib/cjs/common/index.js.map +1 -1
  9. package/lib/cjs/common/props.d.ts +1 -0
  10. package/lib/cjs/common/props.js +10 -0
  11. package/lib/cjs/common/props.js.map +1 -0
  12. package/lib/cjs/components/box/box.d.ts +8 -0
  13. package/lib/cjs/components/box/box.js +25 -0
  14. package/lib/cjs/components/box/box.js.map +1 -0
  15. package/lib/cjs/components/box/box.test.d.ts +1 -0
  16. package/lib/cjs/components/box/box.test.js +80 -0
  17. package/lib/cjs/components/box/box.test.js.map +1 -0
  18. package/lib/cjs/components/box/boxProps.d.ts +246 -0
  19. package/lib/cjs/components/box/boxProps.js +6 -0
  20. package/lib/cjs/components/box/boxProps.js.map +1 -0
  21. package/lib/cjs/components/box/buildStyles.d.ts +23 -0
  22. package/lib/cjs/components/box/buildStyles.js +258 -0
  23. package/lib/cjs/components/box/buildStyles.js.map +1 -0
  24. package/lib/cjs/components/flex/flex.d.ts +7 -0
  25. package/lib/cjs/components/flex/flex.js +18 -0
  26. package/lib/cjs/components/flex/flex.js.map +1 -0
  27. package/lib/cjs/components/flex/flex.test.d.ts +1 -0
  28. package/lib/cjs/components/flex/flex.test.js +59 -0
  29. package/lib/cjs/components/flex/flex.test.js.map +1 -0
  30. package/lib/cjs/components/index.d.ts +3 -1
  31. package/lib/cjs/components/index.js +8 -4
  32. package/lib/cjs/components/index.js.map +1 -1
  33. package/lib/cjs/components/slot/slot.d.ts +7 -0
  34. package/lib/cjs/components/slot/slot.js +31 -0
  35. package/lib/cjs/components/slot/slot.js.map +1 -0
  36. package/lib/cjs/components/slot/slot.test.d.ts +1 -0
  37. package/lib/cjs/components/slot/slot.test.js +47 -0
  38. package/lib/cjs/components/slot/slot.test.js.map +1 -0
  39. package/lib/cjs/index.d.ts +0 -7
  40. package/lib/cjs/index.js +6 -15
  41. package/lib/cjs/index.js.map +1 -1
  42. package/lib/css/blueprint-labs.css +1630 -7
  43. package/lib/css/blueprint-labs.css.map +1 -1
  44. package/lib/esm/common/classes.d.ts +6 -0
  45. package/lib/esm/common/classes.js +16 -0
  46. package/lib/esm/common/classes.js.map +1 -0
  47. package/lib/esm/common/index.d.ts +3 -1
  48. package/lib/esm/common/index.js +6 -4
  49. package/lib/esm/common/index.js.map +1 -1
  50. package/lib/esm/common/props.d.ts +1 -0
  51. package/lib/esm/common/props.js +7 -0
  52. package/lib/esm/common/props.js.map +1 -0
  53. package/lib/esm/components/box/box.d.ts +8 -0
  54. package/lib/esm/components/box/box.js +21 -0
  55. package/lib/esm/components/box/box.js.map +1 -0
  56. package/lib/esm/components/box/box.test.d.ts +1 -0
  57. package/lib/esm/components/box/box.test.js +78 -0
  58. package/lib/esm/components/box/box.test.js.map +1 -0
  59. package/lib/esm/components/box/boxProps.d.ts +246 -0
  60. package/lib/esm/components/box/boxProps.js +5 -0
  61. package/lib/esm/components/box/boxProps.js.map +1 -0
  62. package/lib/esm/components/box/buildStyles.d.ts +23 -0
  63. package/lib/esm/components/box/buildStyles.js +254 -0
  64. package/lib/esm/components/box/buildStyles.js.map +1 -0
  65. package/lib/esm/components/flex/flex.d.ts +7 -0
  66. package/lib/esm/components/flex/flex.js +15 -0
  67. package/lib/esm/components/flex/flex.js.map +1 -0
  68. package/lib/esm/components/flex/flex.test.d.ts +1 -0
  69. package/lib/esm/components/flex/flex.test.js +57 -0
  70. package/lib/esm/components/flex/flex.test.js.map +1 -0
  71. package/lib/esm/components/index.d.ts +3 -1
  72. package/lib/esm/components/index.js +5 -4
  73. package/lib/esm/components/index.js.map +1 -1
  74. package/lib/esm/components/slot/slot.d.ts +7 -0
  75. package/lib/esm/components/slot/slot.js +27 -0
  76. package/lib/esm/components/slot/slot.js.map +1 -0
  77. package/lib/esm/components/slot/slot.test.d.ts +1 -0
  78. package/lib/esm/components/slot/slot.test.js +45 -0
  79. package/lib/esm/components/slot/slot.test.js.map +1 -0
  80. package/lib/esm/index.d.ts +0 -7
  81. package/lib/esm/index.js +5 -12
  82. package/lib/esm/index.js.map +1 -1
  83. package/lib/esnext/common/classes.d.ts +6 -0
  84. package/lib/esnext/common/classes.js +16 -0
  85. package/lib/esnext/common/classes.js.map +1 -0
  86. package/lib/esnext/common/index.d.ts +3 -1
  87. package/lib/esnext/common/index.js +6 -4
  88. package/lib/esnext/common/index.js.map +1 -1
  89. package/lib/esnext/common/props.d.ts +1 -0
  90. package/lib/esnext/common/props.js +7 -0
  91. package/lib/esnext/common/props.js.map +1 -0
  92. package/lib/esnext/components/box/box.d.ts +8 -0
  93. package/lib/esnext/components/box/box.js +21 -0
  94. package/lib/esnext/components/box/box.js.map +1 -0
  95. package/lib/esnext/components/box/box.test.d.ts +1 -0
  96. package/lib/esnext/components/box/box.test.js +78 -0
  97. package/lib/esnext/components/box/box.test.js.map +1 -0
  98. package/lib/esnext/components/box/boxProps.d.ts +246 -0
  99. package/lib/esnext/components/box/boxProps.js +5 -0
  100. package/lib/esnext/components/box/boxProps.js.map +1 -0
  101. package/lib/esnext/components/box/buildStyles.d.ts +23 -0
  102. package/lib/esnext/components/box/buildStyles.js +254 -0
  103. package/lib/esnext/components/box/buildStyles.js.map +1 -0
  104. package/lib/esnext/components/flex/flex.d.ts +7 -0
  105. package/lib/esnext/components/flex/flex.js +15 -0
  106. package/lib/esnext/components/flex/flex.js.map +1 -0
  107. package/lib/esnext/components/flex/flex.test.d.ts +1 -0
  108. package/lib/esnext/components/flex/flex.test.js +57 -0
  109. package/lib/esnext/components/flex/flex.test.js.map +1 -0
  110. package/lib/esnext/components/index.d.ts +3 -1
  111. package/lib/esnext/components/index.js +5 -4
  112. package/lib/esnext/components/index.js.map +1 -1
  113. package/lib/esnext/components/slot/slot.d.ts +7 -0
  114. package/lib/esnext/components/slot/slot.js +27 -0
  115. package/lib/esnext/components/slot/slot.js.map +1 -0
  116. package/lib/esnext/components/slot/slot.test.d.ts +1 -0
  117. package/lib/esnext/components/slot/slot.test.js +45 -0
  118. package/lib/esnext/components/slot/slot.test.js.map +1 -0
  119. package/lib/esnext/index.d.ts +0 -7
  120. package/lib/esnext/index.js +5 -12
  121. package/lib/esnext/index.js.map +1 -1
  122. package/package.json +57 -45
  123. package/src/_common.scss +9 -0
  124. package/src/blueprint-labs.scss +5 -7
  125. package/src/common/classes.ts +20 -0
  126. package/src/common/index.ts +7 -6
  127. package/src/common/props.ts +8 -0
  128. package/src/components/box/_box.scss +543 -0
  129. package/src/components/box/box.md +59 -0
  130. package/src/components/box/box.test.tsx +119 -0
  131. package/src/components/box/box.tsx +32 -0
  132. package/src/components/box/boxProps.ts +334 -0
  133. package/src/components/box/buildStyles.ts +307 -0
  134. package/src/components/flex/flex.md +52 -0
  135. package/src/components/flex/flex.test.tsx +93 -0
  136. package/src/components/flex/flex.tsx +20 -0
  137. package/src/components/index.ts +6 -6
  138. package/src/components/slot/slot.test.tsx +73 -0
  139. package/src/components/slot/slot.tsx +30 -0
  140. package/src/index.md +16 -5
  141. package/src/index.ts +3 -20
  142. package/src/tsconfig.json +5 -3
  143. package/src/vitest-env.d.ts +6 -0
  144. package/vitest.config.mts +17 -0
  145. package/vitest.setup.mts +13 -0
  146. package/dist/labs.bundle.js +0 -1
  147. package/src/components/_index.scss +0 -3
@@ -0,0 +1,246 @@
1
+ /**
2
+ * Prop-type definitions for the <Box> component.
3
+ *
4
+ * The guiding idea behind <Box> is to provide a small, typed subset of the
5
+ * CSS box-model and flexbox APIs as *props* instead of requiring consumers to
6
+ * write custom styles or class names. We purposefully whitelist only a finite
7
+ * number of safe values (see the union literals below) so that:
8
+ *
9
+ * 1. Design-system-approved spacing / sizing tokens can be enforced at compile
10
+ * time.
11
+ * 2. We can consistently translate prop values into utility class names
12
+ * generated by `buildStyles`.
13
+ * 3. Invalid HTML attributes (e.g. `foo="bar"`) are rejected by TypeScript in
14
+ * user code, while *supported* DOM props such as `id`, `title`, etc. are
15
+ * still allowed through the generic overlay.
16
+ */
17
+ import type * as React from "react";
18
+ /**
19
+ * The range of values for spacing tokens.
20
+ */
21
+ type SpacingRange = 0 | 0.5 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
22
+ /**
23
+ * The range of values for size as a percentage.
24
+ */
25
+ type SizeRange = 25 | 50 | 75 | 100;
26
+ /**
27
+ * The range of values for `gap`.
28
+ *
29
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/gap
30
+ */
31
+ export type Gap = SpacingRange | `${SpacingRange}`;
32
+ /**
33
+ * The range of values for `margin`.
34
+ *
35
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/margin
36
+ */
37
+ export type Margin = SpacingRange | `${SpacingRange}` | "auto";
38
+ /**
39
+ * The range of values for `padding`.
40
+ *
41
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/padding
42
+ */
43
+ export type Padding = SpacingRange | `${SpacingRange}`;
44
+ /**
45
+ * The range of values for `inset`.
46
+ *
47
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset
48
+ */
49
+ export type Inset = SpacingRange | `${SpacingRange}`;
50
+ /**
51
+ * The range of values for `width`.
52
+ *
53
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/width
54
+ */
55
+ export type Width = SizeRange | `${SizeRange}` | "auto";
56
+ /**
57
+ * The range of values for `height`.
58
+ *
59
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/height
60
+ */
61
+ export type Height = SizeRange | `${SizeRange}` | "auto";
62
+ /**
63
+ * The range of values for `align-content`.
64
+ *
65
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-content
66
+ */
67
+ export type AlignContent = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | "stretch" | "normal" | "baseline";
68
+ /**
69
+ * The range of values for `align-items`.
70
+ *
71
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-items
72
+ */
73
+ export type AlignItems = "start" | "end" | "center" | "baseline" | "stretch";
74
+ /**
75
+ * The range of values for `align-self`.
76
+ *
77
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/align-self
78
+ */
79
+ export type AlignSelf = "auto" | "start" | "end" | "center" | "baseline" | "stretch";
80
+ /**
81
+ * The range of values for `display`.
82
+ *
83
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/display
84
+ */
85
+ export type Display = "block" | "inline-block" | "inline" | "flex" | "inline-flex" | "grid" | "inline-grid" | "table" | "inline-table" | "table-cell" | "table-row" | "none";
86
+ /**
87
+ * The range of values for `flex`.
88
+ *
89
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex
90
+ */
91
+ export type Flex = 1 | "1" | "auto" | "initial" | "none";
92
+ /**
93
+ * The range of values for `flex-direction`.
94
+ *
95
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction
96
+ */
97
+ export type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
98
+ /**
99
+ * The range of values for `flex-wrap`.
100
+ *
101
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap
102
+ */
103
+ export type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
104
+ /**
105
+ * The range of values for `justify-content`.
106
+ *
107
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content
108
+ */
109
+ export type JustifyContent = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly" | "stretch" | "normal";
110
+ /**
111
+ * The range of values for `justify-items`.
112
+ *
113
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items
114
+ */
115
+ export type JustifyItems = "start" | "end" | "center" | "stretch";
116
+ /**
117
+ * The range of values for `justify-self`.
118
+ *
119
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self
120
+ */
121
+ export type JustifySelf = "auto" | "start" | "end" | "center" | "stretch";
122
+ /**
123
+ * The range of values for `overflow`.
124
+ *
125
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow
126
+ */
127
+ export type Overflow = "visible" | "hidden" | "scroll" | "auto";
128
+ /**
129
+ * The range of values for `position`.
130
+ *
131
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/position
132
+ */
133
+ export type Position = "static" | "absolute" | "relative" | "fixed" | "sticky";
134
+ /**
135
+ * Props for the `<Box>` component.
136
+ *
137
+ * Extends standard HTML div props with Box-specific layout props.
138
+ */
139
+ export interface BoxProps extends React.ComponentPropsWithoutRef<"div"> {
140
+ /**
141
+ * When true, `<Box>` will **not** render an extra wrapper element. Instead, it will
142
+ * clone & enhance its single child element, merging class names and props.
143
+ */
144
+ asChild?: boolean;
145
+ /** Shorthand for the CSS `gap` property (applies to flex and grid layouts). */
146
+ gap?: Gap;
147
+ /** CSS `margin` */
148
+ margin?: Margin;
149
+ /** CSS `margin-inline` */
150
+ marginX?: Margin;
151
+ /** CSS `margin-inline-start` */
152
+ marginXStart?: Margin;
153
+ /** CSS `margin-inline-end` */
154
+ marginXEnd?: Margin;
155
+ /** CSS `margin-block` */
156
+ marginY?: Margin;
157
+ /** CSS `margin-block-start` */
158
+ marginYStart?: Margin;
159
+ /** CSS `margin-block-end` */
160
+ marginYEnd?: Margin;
161
+ /** CSS `margin-top` */
162
+ marginTop?: Margin;
163
+ /** CSS `margin-right` */
164
+ marginRight?: Margin;
165
+ /** CSS `margin-bottom` */
166
+ marginBottom?: Margin;
167
+ /** CSS `margin-left` */
168
+ marginLeft?: Margin;
169
+ /** CSS `padding` */
170
+ padding?: Padding;
171
+ /** CSS `padding-inline` */
172
+ paddingX?: Padding;
173
+ /** CSS `padding-inline-start` */
174
+ paddingXStart?: Padding;
175
+ /** CSS `padding-inline-end` */
176
+ paddingXEnd?: Padding;
177
+ /** CSS `padding-block` */
178
+ paddingY?: Padding;
179
+ /** CSS `padding-block-start` */
180
+ paddingYStart?: Padding;
181
+ /** CSS `padding-block-end` */
182
+ paddingYEnd?: Padding;
183
+ /** CSS `padding-top` */
184
+ paddingTop?: Padding;
185
+ /** CSS `padding-right` */
186
+ paddingRight?: Padding;
187
+ /** CSS `padding-bottom` */
188
+ paddingBottom?: Padding;
189
+ /** CSS `padding-left` */
190
+ paddingLeft?: Padding;
191
+ /** CSS `inset` */
192
+ inset?: Inset;
193
+ /** CSS `inset-inline` */
194
+ insetX?: Inset;
195
+ /** CSS `inset-inline-start` */
196
+ insetXStart?: Inset;
197
+ /** CSS `inset-inline-end` */
198
+ insetXEnd?: Inset;
199
+ /** CSS `inset-block` */
200
+ insetY?: Inset;
201
+ /** CSS `inset-block-start` */
202
+ insetYStart?: Inset;
203
+ /** CSS `inset-block-end` */
204
+ insetYEnd?: Inset;
205
+ /** CSS `top` */
206
+ insetTop?: Inset;
207
+ /** CSS `right` */
208
+ insetRight?: Inset;
209
+ /** CSS `bottom` */
210
+ insetBottom?: Inset;
211
+ /** CSS `left` */
212
+ insetLeft?: Inset;
213
+ /** CSS `width` */
214
+ width?: Width;
215
+ /** CSS `height` */
216
+ height?: Height;
217
+ /** CSS `align-content` */
218
+ alignContent?: AlignContent;
219
+ /** CSS `align-items` */
220
+ alignItems?: AlignItems;
221
+ /** CSS `align-self` */
222
+ alignSelf?: AlignSelf;
223
+ /** CSS `display` */
224
+ display?: Display;
225
+ /** CSS `flex` (shorthand for `flex-grow`, `flex-shrink`, `flex-basis`) */
226
+ flex?: Flex;
227
+ /** CSS `flex-direction` */
228
+ flexDirection?: FlexDirection;
229
+ /** CSS `flex-wrap` */
230
+ flexWrap?: FlexWrap;
231
+ /** CSS `justify-content` */
232
+ justifyContent?: JustifyContent;
233
+ /** CSS `justify-items` */
234
+ justifyItems?: JustifyItems;
235
+ /** CSS `justify-self` */
236
+ justifySelf?: JustifySelf;
237
+ /** CSS `position` */
238
+ position?: Position;
239
+ /** CSS `overflow` */
240
+ overflow?: Overflow;
241
+ /** CSS `overflow-x` */
242
+ overflowX?: Overflow;
243
+ /** CSS `overflow-y` */
244
+ overflowY?: Overflow;
245
+ }
246
+ export {};
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /* !
3
+ * (c) Copyright 2025 Palantir Technologies Inc. All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=boxProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boxProps.js","sourceRoot":"","sources":["../../../../src/components/box/boxProps.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Runtime helper that converts <Box> style-props into utility class names.
3
+ *
4
+ * The implementation is intentionally simple:
5
+ * 1. A prop key that exists in the `styles` map is considered a style prop.
6
+ * Its value is run through a converter (created via `appendValue` or
7
+ * `mapping`) which returns the corresponding class string, e.g.
8
+ * `display="flex"` → `"flex"`.
9
+ * 2. Any prop that is *not* in the map is assumed to be a valid intrinsic
10
+ * DOM attribute (e.g. `id`, `title`) or a component-specific prop and is
11
+ * therefore forwarded untouched.
12
+ *
13
+ * Returns an object with two pieces of information:
14
+ * • `generatedClassNames` – an array of class names to apply to the element.
15
+ * • `passThroughProps` – the remaining props to forward.
16
+ *
17
+ * @param props - The props object to convert.
18
+ * @returns An object with `generatedClassNames` and `passThroughProps`.
19
+ */
20
+ export declare function buildStyles<T extends Record<string, any>>(props: T): {
21
+ generatedClassNames: string[];
22
+ passThroughProps: Record<string, unknown>;
23
+ };
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ /* !
3
+ * (c) Copyright 2025 Palantir Technologies Inc. All rights reserved.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.buildStyles = void 0;
7
+ /* eslint-disable sort-keys */
8
+ const common_1 = require("../../common");
9
+ const NS = common_1.Classes.getClassNamespace();
10
+ /**
11
+ * Runtime helper that converts <Box> style-props into utility class names.
12
+ *
13
+ * The implementation is intentionally simple:
14
+ * 1. A prop key that exists in the `styles` map is considered a style prop.
15
+ * Its value is run through a converter (created via `appendValue` or
16
+ * `mapping`) which returns the corresponding class string, e.g.
17
+ * `display="flex"` → `"flex"`.
18
+ * 2. Any prop that is *not* in the map is assumed to be a valid intrinsic
19
+ * DOM attribute (e.g. `id`, `title`) or a component-specific prop and is
20
+ * therefore forwarded untouched.
21
+ *
22
+ * Returns an object with two pieces of information:
23
+ * • `generatedClassNames` – an array of class names to apply to the element.
24
+ * • `passThroughProps` – the remaining props to forward.
25
+ *
26
+ * @param props - The props object to convert.
27
+ * @returns An object with `generatedClassNames` and `passThroughProps`.
28
+ */
29
+ function buildStyles(props) {
30
+ const classNames = new Set();
31
+ const passThroughProps = {};
32
+ for (const [key, value] of Object.entries(props)) {
33
+ if (Object.prototype.hasOwnProperty.call(styles, key)) {
34
+ const className = styles[key]?.(value);
35
+ if (className != null) {
36
+ classNames.add(className);
37
+ }
38
+ }
39
+ else {
40
+ passThroughProps[key] = value;
41
+ }
42
+ }
43
+ return { generatedClassNames: Array.from(classNames), passThroughProps };
44
+ }
45
+ exports.buildStyles = buildStyles;
46
+ function appendValue(prefix) {
47
+ return (value) => `${NS}-${prefix}-${value}`;
48
+ }
49
+ function mapping(styleMap) {
50
+ return (value) => `${NS}-${styleMap[value]}`;
51
+ }
52
+ const gap = appendValue("gap");
53
+ const margin = appendValue("margin");
54
+ const marginX = appendValue("margin-inline");
55
+ const marginXStart = appendValue("margin-inline-start");
56
+ const marginXEnd = appendValue("margin-inline-end");
57
+ const marginY = appendValue("margin-block");
58
+ const marginYStart = appendValue("margin-block-start");
59
+ const marginYEnd = appendValue("margin-block-end");
60
+ const marginTop = appendValue("margin-top");
61
+ const marginRight = appendValue("margin-right");
62
+ const marginBottom = appendValue("margin-bottom");
63
+ const marginLeft = appendValue("margin-left");
64
+ const padding = appendValue("padding");
65
+ const paddingX = appendValue("padding-inline");
66
+ const paddingXStart = appendValue("padding-inline-start");
67
+ const paddingXEnd = appendValue("padding-inline-end");
68
+ const paddingY = appendValue("padding-block");
69
+ const paddingYStart = appendValue("padding-block-start");
70
+ const paddingYEnd = appendValue("padding-block-end");
71
+ const paddingTop = appendValue("padding-top");
72
+ const paddingRight = appendValue("padding-right");
73
+ const paddingBottom = appendValue("padding-bottom");
74
+ const paddingLeft = appendValue("padding-left");
75
+ const width = mapping({
76
+ 25: "width-25",
77
+ 50: "width-50",
78
+ 75: "width-75",
79
+ 100: "width-100",
80
+ auto: "width-auto",
81
+ });
82
+ const height = mapping({
83
+ 25: "height-25",
84
+ 50: "height-50",
85
+ 75: "height-75",
86
+ 100: "height-100",
87
+ auto: "height-auto",
88
+ });
89
+ const inset = appendValue("inset");
90
+ const insetX = appendValue("inset-inline");
91
+ const insetXStart = appendValue("inset-inline-start");
92
+ const insetXEnd = appendValue("inset-inline-end");
93
+ const insetY = appendValue("inset-block");
94
+ const insetYStart = appendValue("inset-block-start");
95
+ const insetYEnd = appendValue("inset-block-end");
96
+ const insetTop = appendValue("inset-top");
97
+ const insetRight = appendValue("inset-right");
98
+ const insetBottom = appendValue("inset-bottom");
99
+ const insetLeft = appendValue("inset-left");
100
+ const alignContent = mapping({
101
+ start: "content-start",
102
+ center: "content-center",
103
+ end: "content-end",
104
+ "space-between": "content-between",
105
+ "space-around": "content-around",
106
+ "space-evenly": "content-evenly",
107
+ stretch: "content-stretch",
108
+ normal: "content-normal",
109
+ baseline: "content-baseline",
110
+ });
111
+ const alignItems = mapping({
112
+ start: "items-start",
113
+ end: "items-end",
114
+ center: "items-center",
115
+ baseline: "items-baseline",
116
+ stretch: "items-stretch",
117
+ });
118
+ const alignSelf = mapping({
119
+ auto: "self-auto",
120
+ start: "self-start",
121
+ end: "self-end",
122
+ center: "self-center",
123
+ baseline: "self-baseline",
124
+ stretch: "self-stretch",
125
+ });
126
+ const display = mapping({
127
+ block: "block",
128
+ "inline-block": "inline-block",
129
+ inline: "inline",
130
+ flex: "flex",
131
+ "inline-flex": "inline-flex",
132
+ grid: "grid",
133
+ "inline-grid": "inline-grid",
134
+ table: "table",
135
+ "inline-table": "inline-table",
136
+ "table-row": "table-row",
137
+ "table-cell": "table-cell",
138
+ none: "none",
139
+ });
140
+ const flex = mapping({
141
+ "1": "flex-1",
142
+ auto: "flex-auto",
143
+ initial: "flex-initial",
144
+ none: "flex-none",
145
+ });
146
+ const flexDirection = mapping({
147
+ row: "flex-row",
148
+ "row-reverse": "flex-row-reverse",
149
+ column: "flex-column",
150
+ "column-reverse": "flex-column-reverse",
151
+ });
152
+ const flexWrap = mapping({
153
+ nowrap: "flex-nowrap",
154
+ wrap: "flex-wrap",
155
+ "wrap-reverse": "flex-wrap-reverse",
156
+ });
157
+ const justifyContent = mapping({
158
+ start: "justify-start",
159
+ center: "justify-center",
160
+ end: "justify-end",
161
+ "space-between": "justify-between",
162
+ "space-around": "justify-around",
163
+ "space-evenly": "justify-evenly",
164
+ normal: "justify-normal",
165
+ stretch: "justify-stretch",
166
+ });
167
+ const justifyItems = mapping({
168
+ start: "justify-items-start",
169
+ end: "justify-items-end",
170
+ center: "justify-items-center",
171
+ stretch: "justify-items-stretch",
172
+ });
173
+ const justifySelf = mapping({
174
+ auto: "justify-self-auto",
175
+ start: "justify-self-start",
176
+ end: "justify-self-end",
177
+ center: "justify-self-center",
178
+ stretch: "justify-self-stretch",
179
+ });
180
+ const position = mapping({
181
+ static: "static",
182
+ relative: "relative",
183
+ absolute: "absolute",
184
+ fixed: "fixed",
185
+ sticky: "sticky",
186
+ });
187
+ const overflow = mapping({
188
+ visible: "overflow-visible",
189
+ hidden: "overflow-hidden",
190
+ scroll: "overflow-scroll",
191
+ auto: "overflow-auto",
192
+ });
193
+ const overflowX = mapping({
194
+ visible: "overflow-x-visible",
195
+ hidden: "overflow-x-hidden",
196
+ scroll: "overflow-x-scroll",
197
+ auto: "overflow-x-auto",
198
+ });
199
+ const overflowY = mapping({
200
+ visible: "overflow-y-visible",
201
+ hidden: "overflow-y-hidden",
202
+ scroll: "overflow-y-scroll",
203
+ auto: "overflow-y-auto",
204
+ });
205
+ // Look-up table of style-prop name → converter function
206
+ const styles = {
207
+ gap,
208
+ margin,
209
+ marginX,
210
+ marginXStart,
211
+ marginXEnd,
212
+ marginY,
213
+ marginYStart,
214
+ marginYEnd,
215
+ marginTop,
216
+ marginRight,
217
+ marginBottom,
218
+ marginLeft,
219
+ padding,
220
+ paddingX,
221
+ paddingXStart,
222
+ paddingXEnd,
223
+ paddingY,
224
+ paddingYStart,
225
+ paddingYEnd,
226
+ paddingTop,
227
+ paddingRight,
228
+ paddingBottom,
229
+ paddingLeft,
230
+ inset,
231
+ insetX,
232
+ insetXStart,
233
+ insetXEnd,
234
+ insetY,
235
+ insetYStart,
236
+ insetYEnd,
237
+ insetTop,
238
+ insetRight,
239
+ insetBottom,
240
+ insetLeft,
241
+ width,
242
+ height,
243
+ alignContent,
244
+ alignItems,
245
+ alignSelf,
246
+ display,
247
+ flex,
248
+ flexDirection,
249
+ flexWrap,
250
+ justifyContent,
251
+ justifyItems,
252
+ justifySelf,
253
+ position,
254
+ overflow,
255
+ overflowX,
256
+ overflowY,
257
+ };
258
+ //# sourceMappingURL=buildStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildStyles.js","sourceRoot":"","sources":["../../../../src/components/box/buildStyles.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8BAA8B;AAE9B,yCAAuC;AAuBvC,MAAM,EAAE,GAAG,gBAAO,CAAC,iBAAiB,EAAE,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAgC,KAAQ;IAC/D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,MAAM,gBAAgB,GAA4B,EAAE,CAAC;IAErD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,I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,UAAU;IACV,WAAW;IACX,SAAS;IAET,KAAK;IACL,MAAM;IAEN,YAAY;IACZ,UAAU;IACV,SAAS;IACT,OAAO;IACP,IAAI;IACJ,aAAa;IACb,QAAQ;IACR,cAAc;IACd,YAAY;IACZ,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;CACZ,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from "../box/boxProps";
3
+ export type FlexProps = Omit<BoxProps, "display">;
4
+ /**
5
+ * Flex component.
6
+ */
7
+ export declare const Flex: import("react").ForwardRefExoticComponent<FlexProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Flex = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ /* !
6
+ * (c) Copyright 2025 Palantir Technologies Inc. All rights reserved.
7
+ */
8
+ const react_1 = require("react");
9
+ const common_1 = require("../../common");
10
+ const box_1 = require("../box/box");
11
+ /**
12
+ * Flex component.
13
+ */
14
+ exports.Flex = (0, react_1.forwardRef)(function Flex(props, ref) {
15
+ return (0, jsx_runtime_1.jsx)(box_1.Box, { ...props, display: "flex", ref: ref });
16
+ });
17
+ exports.Flex.displayName = `${common_1.DISPLAYNAME_PREFIX}.Flex`;
18
+ //# sourceMappingURL=flex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex.js","sourceRoot":"","sources":["../../../../src/components/flex/flex.tsx"],"names":[],"mappings":";;;;AAAA;;GAEG;AAEH,iCAAmC;AAEnC,yCAAkD;AAClD,oCAAiC;AAKjC;;GAEG;AACU,QAAA,IAAI,GAAG,IAAA,kBAAU,EAA4B,SAAS,IAAI,CAAC,KAAK,EAAE,GAAG;IAC9E,OAAO,uBAAC,SAAG,OAAK,KAAK,EAAE,OAAO,EAAC,MAAM,EAAC,GAAG,EAAE,GAAG,GAAI,CAAC;AACvD,CAAC,CAAC,CAAC;AAEH,YAAI,CAAC,WAAW,GAAG,GAAG,2BAAkB,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /* !
5
+ * (c) Copyright 2025 Palantir Technologies Inc. All rights reserved.
6
+ */
7
+ const react_1 = require("@testing-library/react");
8
+ const vitest_1 = require("vitest");
9
+ const core_1 = require("@blueprintjs/core");
10
+ const common_1 = require("../../common");
11
+ const flex_1 = require("./flex");
12
+ const NS = common_1.Classes.getClassNamespace();
13
+ (0, vitest_1.describe)("<Flex>", () => {
14
+ (0, vitest_1.it)("should render content", () => {
15
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { children: "Test" }));
16
+ const flex = react_1.screen.getByText(/test/i);
17
+ (0, vitest_1.expect)(flex).toBeInTheDocument();
18
+ });
19
+ (0, vitest_1.it)("should always set display flex", () => {
20
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { children: "Test" }));
21
+ const flex = react_1.screen.getByText(/test/i);
22
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-flex`);
23
+ });
24
+ (0, vitest_1.it)("should pass through Box props", () => {
25
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { gap: 2, flexDirection: "column", "data-testid": "flex-test", children: "Test" }));
26
+ const flex = react_1.screen.getByTestId("flex-test");
27
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-gap-2`);
28
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-flex-column`);
29
+ });
30
+ (0, vitest_1.it)("should support className", () => {
31
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { className: "custom-class", children: "Test" }));
32
+ const flex = react_1.screen.getByText(/test/i);
33
+ (0, vitest_1.expect)(flex).toHaveClass("custom-class");
34
+ (0, vitest_1.expect)(flex).toHaveClass(common_1.Classes.BOX);
35
+ });
36
+ (0, vitest_1.it)("should support style prop", () => {
37
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { style: { fontWeight: 700 }, children: "Test" }));
38
+ const flex = react_1.screen.getByText(/test/i);
39
+ (0, vitest_1.expect)(flex).toHaveStyle({ fontWeight: 700 });
40
+ });
41
+ (0, vitest_1.it)("should support asChild prop", () => {
42
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { asChild: true, gap: 2, children: (0, jsx_runtime_1.jsx)(core_1.Button, { intent: "primary", children: "Test" }) }));
43
+ const button = react_1.screen.getByRole("button", { name: /test/i });
44
+ (0, vitest_1.expect)(button).toHaveClass(common_1.Classes.BOX);
45
+ (0, vitest_1.expect)(button).toHaveClass(core_1.Classes.BUTTON);
46
+ (0, vitest_1.expect)(button).toHaveClass(`${NS}-flex`);
47
+ (0, vitest_1.expect)(button).toHaveClass(`${NS}-gap-2`);
48
+ });
49
+ (0, vitest_1.it)("should support all flex-related props", () => {
50
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(flex_1.Flex, { flexDirection: "row", flexWrap: "wrap", justifyContent: "center", alignItems: "center", gap: 3, "data-testid": "flex-all-props", children: "Test" }));
51
+ const flex = react_1.screen.getByTestId("flex-all-props");
52
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-flex-row`);
53
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-flex-wrap`);
54
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-justify-center`);
55
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-items-center`);
56
+ (0, vitest_1.expect)(flex).toHaveClass(`${NS}-gap-3`);
57
+ });
58
+ });
59
+ //# sourceMappingURL=flex.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex.test.js","sourceRoot":"","sources":["../../../../src/components/flex/flex.test.tsx"],"names":[],"mappings":";;;AAAA;;GAEG;AAEH,kDAAwD;AACxD,mC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