@ornikar/bumper 3.11.0 → 3.12.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 (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/definitions/index.d.ts +2 -0
  3. package/dist/definitions/index.d.ts.map +1 -1
  4. package/dist/definitions/system/dataDisplays/Sticker/Sticker.d.ts +18 -0
  5. package/dist/definitions/system/dataDisplays/Sticker/Sticker.d.ts.map +1 -0
  6. package/dist/definitions/system/dataDisplays/Sticker/components/StickerLabel.d.ts +7 -0
  7. package/dist/definitions/system/dataDisplays/Sticker/components/StickerLabel.d.ts.map +1 -0
  8. package/dist/definitions/system/dataDisplays/Sticker/context.d.ts +3 -0
  9. package/dist/definitions/system/dataDisplays/Sticker/context.d.ts.map +1 -0
  10. package/dist/definitions/system/dataDisplays/Sticker/types.d.ts +24 -0
  11. package/dist/definitions/system/dataDisplays/Sticker/types.d.ts.map +1 -0
  12. package/dist/definitions/system/layout/divider/Divider.d.ts.map +1 -1
  13. package/dist/definitions/system/types.d.ts +10 -9
  14. package/dist/definitions/system/types.d.ts.map +1 -1
  15. package/dist/index-metro.es.android.js +146 -9
  16. package/dist/index-metro.es.android.js.map +1 -1
  17. package/dist/index-metro.es.ios.js +146 -9
  18. package/dist/index-metro.es.ios.js.map +1 -1
  19. package/dist/index-node-22.22.cjs.js +145 -6
  20. package/dist/index-node-22.22.cjs.js.map +1 -1
  21. package/dist/index-node-22.22.cjs.web.js +145 -6
  22. package/dist/index-node-22.22.cjs.web.js.map +1 -1
  23. package/dist/index-node-22.22.es.mjs +145 -7
  24. package/dist/index-node-22.22.es.mjs.map +1 -1
  25. package/dist/index-node-22.22.es.web.mjs +145 -7
  26. package/dist/index-node-22.22.es.web.mjs.map +1 -1
  27. package/dist/index.es.js +141 -9
  28. package/dist/index.es.js.map +1 -1
  29. package/dist/index.es.web.js +141 -9
  30. package/dist/index.es.web.js.map +1 -1
  31. package/dist/tsbuildinfo +1 -1
  32. package/docs/migration/Sticker.md +222 -0
  33. package/package.json +1 -1
  34. package/src/index.ts +2 -0
  35. package/src/system/dataDisplays/Sticker/Sticker.features.stories.tsx +50 -0
  36. package/src/system/dataDisplays/Sticker/Sticker.mdx +38 -0
  37. package/src/system/dataDisplays/Sticker/Sticker.stories.tsx +49 -0
  38. package/src/system/dataDisplays/Sticker/Sticker.tsx +52 -0
  39. package/src/system/dataDisplays/Sticker/__snapshots__/Sticker.features.stories.tsx.snap +747 -0
  40. package/src/system/dataDisplays/Sticker/__snapshots__/Sticker.stories.tsx.snap +52 -0
  41. package/src/system/dataDisplays/Sticker/__snapshots_web__/Sticker.features.stories.tsx.snap +294 -0
  42. package/src/system/dataDisplays/Sticker/__snapshots_web__/Sticker.stories.tsx.snap +35 -0
  43. package/src/system/dataDisplays/Sticker/components/StickerLabel.tsx +33 -0
  44. package/src/system/dataDisplays/Sticker/context.ts +10 -0
  45. package/src/system/dataDisplays/Sticker/types.ts +61 -0
  46. package/src/system/layout/divider/Divider.tsx +7 -2
  47. package/src/system/layout/divider/__snapshots_web__/Divider.features.stories.tsx.snap +7 -0
  48. package/src/system/layout/divider/__snapshots_web__/Divider.stories.tsx.snap +1 -0
  49. package/src/system/types.ts +26 -14
@@ -4,6 +4,7 @@ import type {
4
4
  TokensParsed,
5
5
  WithMediaProps,
6
6
  } from '@tamagui/core';
7
+ import type { ReactNode } from 'react';
7
8
 
8
9
  /**
9
10
  * Rewrite of Tamagui PropsWithoutMediaStyles to make all responsive props optionnal.
@@ -29,14 +30,14 @@ export type TamaguiMediaProps<A> = PropsWithoutMediaStyles<A> & WithMediaProps<I
29
30
  export type DefaultIgnoredKeys = 'children';
30
31
 
31
32
  /**
32
- * Maps a component's variant-prop interface `T` to a Tamagui `variants` config whose entries produce
33
- * style objects of type `V`.
33
+ * Maps a component's variant-prop interface `VariantProps` to a Tamagui `variants` config whose
34
+ * entries produce style objects of type `StyleProps`.
34
35
  *
35
- * For each key `K` of `T`, the entry must be either:
36
+ * For each key `K` of `VariantProps`, the entry must be either:
36
37
  * - a record keyed by the prop's literal values (with `boolean` props normalised to `'true' | 'false'`),
37
- * where each value is a style `V` or a function returning `V`, or
38
+ * where each value is a `StyleProps` or a function returning `StyleProps`, or
38
39
  * - a function that receives the raw prop value and a {@link VariantGoodiesParams} context and returns
39
- * a style `V` (or `undefined`).
40
+ * a `StyleProps` (or `undefined`).
40
41
  *
41
42
  * Pass a union of keys as `IgnoredKeys` to skip props that should never be variants (e.g.
42
43
  * event handlers). Ignored keys are stripped only from both the top-level map, not from `params.props`.
@@ -45,13 +46,24 @@ export type DefaultIgnoredKeys = 'children';
45
46
  * config is inferred `as const` while still being checked against the component's prop types, e.g.
46
47
  * `{ ... } as const satisfies PropsToTamaguiVariants<MyVariantProps, ViewProps, 'size'>`.
47
48
  */
48
- export type PropsToTamaguiVariants<T, V, IgnoredKeys extends keyof T = never> = {
49
- [K in keyof T as K extends IgnoredKeys | Extract<keyof T, DefaultIgnoredKeys> ? never : K]: NonNullable<
50
- T[K]
51
- > extends boolean
52
- ? Record<'true' | 'false', V | ((value: boolean | string | number, params: VariantGoodiesParams<T>) => V)>
53
- : NonNullable<T[K]> extends PropertyKey
54
- ? Record<NonNullable<T[K]>, V> | ((value: NonNullable<T[K]>, params: VariantGoodiesParams<T>) => V | undefined)
49
+ export type PropsToTamaguiVariants<VariantProps, StyleProps, IgnoredKeys extends keyof VariantProps = never> = {
50
+ [K in keyof VariantProps as K extends IgnoredKeys | Extract<keyof VariantProps, DefaultIgnoredKeys>
51
+ ? never
52
+ : K]: NonNullable<VariantProps[K]> extends boolean
53
+ ? Record<
54
+ 'true' | 'false',
55
+ | StyleProps
56
+ | ((value: boolean | string | number, params: VariantGoodiesParams<VariantProps & StyleProps>) => StyleProps)
57
+ >
58
+ : NonNullable<VariantProps[K]> extends PropertyKey
59
+ ?
60
+ | Record<NonNullable<VariantProps[K]>, StyleProps>
61
+ | ((
62
+ value: NonNullable<VariantProps[K]>,
63
+ params: VariantGoodiesParams<VariantProps & StyleProps>,
64
+ ) => StyleProps | undefined)
65
+ : NonNullable<VariantProps[K]> extends ReactNode
66
+ ? StyleProps
55
67
  : never;
56
68
  };
57
69
 
@@ -62,7 +74,7 @@ export type PropsToTamaguiVariants<T, V, IgnoredKeys extends keyof T = never> =
62
74
  * props (e.g. read `disabled` or `isOnContrasted` while resolving `type`).
63
75
  * - `tokens`: Tamagui's parsed token map, for resolving design tokens from inside the variant.
64
76
  */
65
- interface VariantGoodiesParams<T> {
66
- props: T;
77
+ interface VariantGoodiesParams<Props> {
78
+ props: Props;
67
79
  tokens: TokensParsed;
68
80
  }