gantri-components 2.233.0 → 2.235.6

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 (52) hide show
  1. package/CLAUDE.md +111 -1
  2. package/dist/components/box/box.types.d.ts +1 -1
  3. package/dist/components/button/button.types.d.ts +3 -3
  4. package/dist/components/button-menu/button-menu.d.ts +1 -4
  5. package/dist/components/checkbox-list/checkbox-list.d.ts +1 -4
  6. package/dist/components/color-picker/color-picker.types.d.ts +12 -1
  7. package/dist/components/color-picker/components/color-picker-item/color-picker-item.styles.d.ts +4 -4
  8. package/dist/components/color-picker/components/color-picker-item/color-picker-item.types.d.ts +2 -2
  9. package/dist/components/dropdown-menu/dropdown-menu.d.ts +1 -4
  10. package/dist/components/file-uploader/components/file-uploader-thumbnail-variant/file-uploader-thumbnail-variant.d.ts +1 -4
  11. package/dist/components/file-uploader/file-uploader.d.ts +1 -4
  12. package/dist/components/icon/generated/work/Moon.d.ts +3 -0
  13. package/dist/components/icon/generated/work/Moon24.d.ts +3 -0
  14. package/dist/components/icon/generated/work/index.d.ts +2 -0
  15. package/dist/components/icon/icon.type.d.ts +1 -1
  16. package/dist/components/index.d.ts +1 -0
  17. package/dist/components/multi-select-list/multi-select-list.d.ts +1 -4
  18. package/dist/components/option-selector/option-selector.d.ts +1 -4
  19. package/dist/components/picture/__test__/build-cloudinary-url.test.d.ts +1 -0
  20. package/dist/components/picture/__test__/build-srcset.test.d.ts +1 -0
  21. package/dist/components/picture/__test__/detect-source.test.d.ts +1 -0
  22. package/dist/components/picture/__test__/picture.test.d.ts +1 -0
  23. package/dist/components/picture/helpers/build-cloudinary-url.d.ts +21 -0
  24. package/dist/components/picture/helpers/build-placeholder.d.ts +2 -0
  25. package/dist/components/picture/helpers/build-srcset.d.ts +22 -0
  26. package/dist/components/picture/helpers/detect-source.d.ts +2 -0
  27. package/dist/components/picture/helpers/index.d.ts +5 -0
  28. package/dist/components/picture/helpers/normalize-resolution-aware.d.ts +8 -0
  29. package/dist/components/picture/index.d.ts +3 -0
  30. package/dist/components/picture/picture.d.ts +3 -0
  31. package/dist/components/picture/picture.presets.d.ts +2 -0
  32. package/dist/components/picture/picture.styles.d.ts +8 -0
  33. package/dist/components/picture/picture.types.d.ts +72 -0
  34. package/dist/components/radio/radio.d.ts +1 -4
  35. package/dist/components/radio-list/radio-list.d.ts +1 -4
  36. package/dist/components/responsive/responsive.d.ts +19 -0
  37. package/dist/components/responsive/responsive.types.d.ts +4 -0
  38. package/dist/components/search-field/search-field.d.ts +1 -4
  39. package/dist/components/table/components/table-actions-wrapper/components/paging/paging.d.ts +1 -4
  40. package/dist/components/table/components/table-actions-wrapper/components/search/search.d.ts +1 -4
  41. package/dist/components/table/components/table-row/helpers/get-row-component-props/get-row-component-props.d.ts +1 -1
  42. package/dist/components/table/table.d.ts +1 -4
  43. package/dist/helpers/get-file-url/helpers/get-cloudinary-prefix/get-cloudinary-prefix.d.ts +2 -2
  44. package/dist/index.cjs.js +1 -1
  45. package/dist/index.d.ts +2 -1
  46. package/dist/index.esm.js +1 -1
  47. package/dist/styles/__tests__/media-style.test.d.ts +1 -0
  48. package/dist/styles/index.d.ts +1 -0
  49. package/dist/styles/media-style.d.ts +56 -0
  50. package/dist/styles/media.d.ts +7 -0
  51. package/dist/styles/theme.d.ts +21 -285
  52. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export { getButtonsColors, getThemeColor, getThemeSpacing, palette, spacing, lightTheme, darkTheme, modernLightTheme, modernDarkTheme, createTheme, } from './theme';
2
2
  export { themeStyle } from './theme-style';
3
+ export { mediaStyle } from './media-style';
3
4
  export { type PaletteColor as Color } from './theme';
4
5
  export { ThemeProvider } from './theme-provider';
5
6
  export { ScopedThemeProvider } from './scoped-theme-provider';
@@ -0,0 +1,56 @@
1
+ import { DefaultTheme } from 'styled-components';
2
+ type Breakpoint = 'lg' | 'md' | 'sm';
3
+ type MediaStyleValue<P = Record<string, unknown>> = any | ((props: P & {
4
+ theme: DefaultTheme;
5
+ }) => any);
6
+ type MediaStyleMap<P = Record<string, unknown>> = Partial<Record<Breakpoint, MediaStyleValue<P>>>;
7
+ /**
8
+ * Resolves CSS blocks per breakpoint with a `lg → md → sm` cascade, mirroring
9
+ * how `ResolutionAwareProp` works on component props.
10
+ *
11
+ * - `lg` is the base (no media query) and applies at every breakpoint unless
12
+ * overridden.
13
+ * - `md` is wrapped in `@media (max-width: <md>)` and overrides `lg` for
14
+ * tablet and below.
15
+ * - `sm` is wrapped in `@media (max-width: <sm>)` and overrides everything
16
+ * for mobile only.
17
+ *
18
+ * Each block must be a `css` tagged template (or a function returning one) —
19
+ * this enables CSS autocomplete and syntax highlighting in your editor.
20
+ *
21
+ * Prefer this over `media.lessThan('md')` / `media.lessThan('sm')` calls
22
+ * spread across a stylesheet — colocates all breakpoint variants in one block.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * import styled, { mediaStyle, css } from 'gantri-components';
27
+ *
28
+ * const StyledCard = styled.div`
29
+ * border: 1px solid var(--divider-t1);
30
+ *
31
+ * ${mediaStyle({
32
+ * lg: css`border-radius: 16px;`,
33
+ * md: css`border-radius: 8px;`,
34
+ * sm: css`border-radius: 4px;`,
35
+ * })}
36
+ * `;
37
+ * ```
38
+ *
39
+ * Renders to:
40
+ * ```css
41
+ * border-radius: 16px;
42
+ * @media (max-width: 1024px) { border-radius: 8px; }
43
+ * @media (max-width: 720px) { border-radius: 4px; }
44
+ * ```
45
+ *
46
+ * Use a function when you need to read styled-component props:
47
+ * ```ts
48
+ * ${mediaStyle<{ $highlighted: boolean }>({
49
+ * lg: ({ $highlighted }) => css`
50
+ * background: ${$highlighted ? 'var(--surface-green-t1)' : 'transparent'};
51
+ * `,
52
+ * })}
53
+ * ```
54
+ */
55
+ export declare const mediaStyle: <P = Record<string, unknown>>(styles: Partial<Record<Breakpoint, any>>) => import("styled-components").RuleSet<object>;
56
+ export {};
@@ -3,6 +3,13 @@ export declare const mediaBreakpoints: {
3
3
  md: string;
4
4
  sm: string;
5
5
  };
6
+ /**
7
+ * @deprecated Prefer `mediaStyle` for `lessThan('md')` / `lessThan('sm')`
8
+ * use cases — it colocates lg/md/sm CSS blocks in a single declaration with
9
+ * the same cascade as `ResolutionAwareProp`. This `media` helper remains
10
+ * exported for backward compatibility with `greaterThan` / `between` cases
11
+ * that `mediaStyle` does not cover.
12
+ */
6
13
  export declare const media: import("styled-media-query").MediaGenerator<{
7
14
  lg: string;
8
15
  md: string;
@@ -1,10 +1,9 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
2
  import { Property } from 'csstype';
3
- import { ResolutionAwareProp } from '../types/resolution-aware-prop.type';
4
- import { ButtonSize, ButtonVariant } from '../components/button/button.types';
5
- import { BoxDimension } from '../components/box/box.types';
6
- import { LabelPosition, TextFieldSize, TextFieldVariant } from '../components/text-field';
7
- import { TextVariant } from '../components/typography';
3
+ import type { ResolutionAwareProp } from '../types';
4
+ import type { ButtonSize, ButtonVariant } from '../components/button/button.types';
5
+ import type { BoxDimension } from '../components/box/box.types';
6
+ import type { LabelPosition, TextFieldSize, TextFieldVariant, TextVariant } from '../components';
8
7
  export type PaletteColor = 'amber_100' | 'amber_200' | 'amber_300' | 'amber_400' | 'amber_500' | 'amber_800' | 'amber_900' | 'blue_100' | 'blue_200' | 'blue_300' | 'blue_400' | 'blue_500' | 'blue_800' | 'blue_900' | 'gold_100' | 'gold_200' | 'gold_300' | 'gold_400' | 'gold_500' | 'green_100' | 'green_200' | 'green_300' | 'green_400' | 'green_500' | 'green_800' | 'green_900' | 'monochrome_050' | 'monochrome_100' | 'monochrome_200' | 'monochrome_300' | 'monochrome_400' | 'monochrome_500' | 'monochrome_600' | 'monochrome_700' | 'monochrome_800' | 'monochrome_900' | 'monochrome_black' | 'monochrome_white' | 'pink_300' | 'pink_400' | 'pink_500' | 'red_100' | 'red_200' | 'red_300' | 'red_400' | 'red_500' | 'red_800' | 'red_900' | 'translucent_black_t1' | 'translucent_black_t2' | 'translucent_cream' | 'translucent_white' | 'yellow_100' | 'yellow_200' | 'yellow_300' | 'yellow_400' | 'yellow_500' | 'yellow_800' | 'yellow_900' | string;
9
8
  export declare const palette: Record<PaletteColor, string>;
10
9
  declare module 'styled-components' {
@@ -236,292 +235,29 @@ export interface ProductColorDetails {
236
235
  shortColorName: string;
237
236
  status: ProductColorStatus;
238
237
  }
239
- declare const productColorsDefinition: {
240
- blossompink: {
241
- code: string;
242
- fullColorName: string;
243
- hexColor: string;
244
- inventoryColor: string;
245
- shortColorName: string;
246
- status: "active";
247
- };
248
- canyon: {
249
- code: string;
250
- fullColorName: string;
251
- hexColor: string;
252
- inventoryColor: string;
253
- shortColorName: string;
254
- status: "active";
255
- };
256
- carbon: {
257
- code: string;
258
- fullColorName: string;
259
- hexColor: string;
260
- inventoryColor: string;
261
- shortColorName: string;
262
- status: "active";
263
- };
264
- cobalt: {
265
- code: string;
266
- fullColorName: string;
267
- hexColor: string;
268
- inventoryColor: string;
269
- shortColorName: string;
270
- status: "active";
271
- };
272
- coral: {
273
- code: string;
274
- fullColorName: string;
275
- hexColor: string;
276
- inventoryColor: string;
277
- shortColorName: string;
278
- status: "archived";
279
- };
280
- fog: {
281
- code: string;
282
- fullColorName: string;
283
- hexColor: string;
284
- inventoryColor: string;
285
- shortColorName: string;
286
- status: "archived";
287
- };
288
- forest: {
289
- code: string;
290
- fullColorName: string;
291
- hexColor: string;
292
- inventoryColor: string;
293
- shortColorName: string;
294
- status: "archived";
295
- };
296
- gantri: {
297
- availability: {
298
- flag: "allowGantriColors";
299
- type: "flag-gated";
300
- };
301
- code: string;
302
- fullColorName: string;
303
- hexColor: string;
304
- inventoryColor: string;
305
- shortColorName: string;
306
- status: "active";
307
- };
308
- glossysnowwhite: {
309
- availability: {
310
- productIds: number[];
311
- type: "only-on-products";
312
- };
313
- code: string;
314
- fullColorName: string;
315
- hexColor: string;
316
- inventoryColor: string;
317
- shortColorName: string;
318
- status: "archived";
319
- };
320
- hibiscus: {
321
- code: string;
322
- fullColorName: string;
323
- hexColor: string;
324
- inventoryColor: string;
325
- shortColorName: string;
326
- status: "archived";
327
- };
328
- lichen: {
329
- code: string;
330
- fullColorName: string;
331
- hexColor: string;
332
- inventoryColor: string;
333
- shortColorName: string;
334
- status: "active";
335
- };
336
- lilac: {
337
- code: string;
338
- fullColorName: string;
339
- hexColor: string;
340
- inventoryColor: string;
341
- shortColorName: string;
342
- status: "active";
343
- };
344
- magnolia: {
345
- code: string;
346
- fullColorName: string;
347
- hexColor: string;
348
- inventoryColor: string;
349
- shortColorName: string;
350
- status: "active";
351
- };
352
- manzanita: {
353
- code: string;
354
- fullColorName: string;
355
- hexColor: string;
356
- inventoryColor: string;
357
- shortColorName: string;
358
- status: "active";
359
- };
360
- meadow: {
361
- code: string;
362
- fullColorName: string;
363
- hexColor: string;
364
- inventoryColor: string;
365
- shortColorName: string;
366
- status: "active";
367
- };
368
- midnight: {
369
- code: string;
370
- fullColorName: string;
371
- hexColor: string;
372
- inventoryColor: string;
373
- shortColorName: string;
374
- status: "active";
375
- };
376
- mist: {
377
- code: string;
378
- fullColorName: string;
379
- hexColor: string;
380
- inventoryColor: string;
381
- shortColorName: string;
382
- status: "active";
383
- };
384
- mustard: {
385
- code: string;
386
- fullColorName: string;
387
- hexColor: string;
388
- inventoryColor: string;
389
- shortColorName: string;
390
- status: "active";
391
- };
392
- olive: {
393
- code: string;
394
- fullColorName: string;
395
- hexColor: string;
396
- inventoryColor: string;
397
- shortColorName: string;
398
- status: "active";
399
- };
400
- peach: {
401
- code: string;
402
- fullColorName: string;
403
- hexColor: string;
404
- inventoryColor: string;
405
- shortColorName: string;
406
- status: "active";
407
- };
408
- persimmon: {
409
- code: string;
410
- fullColorName: string;
411
- hexColor: string;
412
- inventoryColor: string;
413
- shortColorName: string;
414
- status: "active";
415
- };
416
- poppy: {
417
- code: string;
418
- fullColorName: string;
419
- hexColor: string;
420
- inventoryColor: string;
421
- shortColorName: string;
422
- status: "active";
423
- };
424
- sage: {
425
- code: string;
426
- fullColorName: string;
427
- hexColor: string;
428
- inventoryColor: string;
429
- shortColorName: string;
430
- status: "active";
431
- };
432
- sand: {
433
- code: string;
434
- fullColorName: string;
435
- hexColor: string;
436
- inventoryColor: string;
437
- shortColorName: string;
438
- status: "active";
439
- };
440
- sedona: {
441
- code: string;
442
- fullColorName: string;
443
- hexColor: string;
444
- inventoryColor: string;
445
- shortColorName: string;
446
- status: "active";
447
- };
448
- sky: {
449
- code: string;
450
- fullColorName: string;
451
- hexColor: string;
452
- inventoryColor: string;
453
- shortColorName: string;
454
- status: "archived";
455
- };
456
- smoke: {
457
- code: string;
458
- fullColorName: string;
459
- hexColor: string;
460
- inventoryColor: string;
461
- shortColorName: string;
462
- status: "active";
463
- };
464
- snow: {
465
- code: string;
466
- fullColorName: string;
467
- hexColor: string;
468
- inventoryColor: string;
469
- shortColorName: string;
470
- status: "active";
471
- };
472
- sproutgreen: {
473
- code: string;
474
- fullColorName: string;
475
- hexColor: string;
476
- inventoryColor: string;
477
- shortColorName: string;
478
- status: "archived";
479
- };
480
- spruce: {
481
- code: string;
482
- fullColorName: string;
483
- hexColor: string;
484
- inventoryColor: string;
485
- shortColorName: string;
486
- status: "active";
487
- };
488
- stone: {
489
- code: string;
490
- fullColorName: string;
491
- hexColor: string;
492
- inventoryColor: string;
493
- shortColorName: string;
494
- status: "active";
495
- };
496
- sunrise: {
497
- code: string;
498
- fullColorName: string;
499
- hexColor: string;
500
- inventoryColor: string;
501
- shortColorName: string;
502
- status: "active";
503
- };
504
- walnut: {
505
- code: string;
506
- fullColorName: string;
507
- hexColor: string;
508
- inventoryColor: string;
509
- shortColorName: string;
510
- status: "active";
511
- };
512
- };
238
+ /** Shape of a color entry before ProductColorCode is derived. */
239
+ interface ProductColorEntry {
240
+ availability?: ColorAvailabilityRule;
241
+ code: string;
242
+ fullColorName: string;
243
+ hexColor: string;
244
+ inventoryColor: string;
245
+ shortColorName: string;
246
+ status: ProductColorStatus;
247
+ }
248
+ declare const productColorsDefinition: Record<string, ProductColorEntry>;
513
249
  export type ProductColorCode = keyof typeof productColorsDefinition;
514
- export declare const productColorsMap: Record<"blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut", ProductColorDetails>;
250
+ export declare const productColorsMap: Record<string, ProductColorDetails>;
515
251
  /** All product color codes, auto-derived from productColorsMap. */
516
- export declare const allProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
252
+ export declare const allProductColorCodes: string[];
517
253
  /** Color codes that are currently active. */
518
- export declare const activeProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
254
+ export declare const activeProductColorCodes: string[];
519
255
  /** Color codes that have been archived (no longer offered but may exist on past orders). */
520
- export declare const archivedProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
256
+ export declare const archivedProductColorCodes: string[];
521
257
  /** @deprecated Use archivedProductColorCodes. Kept for backward compatibility. */
522
- export declare const retiredProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
258
+ export declare const retiredProductColorCodes: string[];
523
259
  /** Active color codes for consumer-facing UIs (excludes archived). */
524
- export declare const consumerProductColorCodes: ("blossompink" | "canyon" | "carbon" | "cobalt" | "coral" | "fog" | "forest" | "gantri" | "glossysnowwhite" | "hibiscus" | "lichen" | "lilac" | "magnolia" | "manzanita" | "meadow" | "midnight" | "mist" | "mustard" | "olive" | "peach" | "persimmon" | "poppy" | "sage" | "sand" | "sedona" | "sky" | "smoke" | "snow" | "sproutgreen" | "spruce" | "stone" | "sunrise" | "walnut")[];
260
+ export declare const consumerProductColorCodes: string[];
525
261
  export declare const lightTheme: DefaultTheme;
526
262
  export declare const darkTheme: DefaultTheme;
527
263
  export declare const modernLightTheme: DefaultTheme;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "gantri-components",
3
- "version": "2.233.0",
3
+ "version": "2.235.6",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
- "repository": "git@github.com:gantri/gantri-components.git",
7
+ "repository": "https://github.com/gantri/gantri-components.git",
8
8
  "author": "Danny <danny@gantri.com>",
9
9
  "sideEffects": false,
10
10
  "license": "MIT",