@cdx-ui/components 0.2.3 → 0.2.4
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/AGENTS.md +24 -0
- package/README.md +2 -0
- package/coverage.svg +1 -1
- package/docs/components/accordion/content.md +538 -0
- package/docs/components/alert/content.md +203 -0
- package/docs/components/alert-dialog/content.md +319 -0
- package/docs/components/avatar/content.md +368 -0
- package/docs/components/avatar/design.md +202 -0
- package/docs/components/badge/content.md +235 -0
- package/docs/components/bottom-sheet/content.md +351 -0
- package/docs/components/bottom-sheet/design.md +249 -0
- package/docs/components/breadcrumbs/content.md +169 -0
- package/docs/components/button/content.md +398 -0
- package/docs/components/button/design.md +258 -0
- package/docs/components/calendar/content.md +137 -0
- package/docs/components/card/content.md +283 -0
- package/docs/components/carousel/content.md +416 -0
- package/docs/components/checkbox/content.md +236 -0
- package/docs/components/checkbox/design.md +214 -0
- package/docs/components/chip/content.md +439 -0
- package/docs/components/chip/design.md +418 -0
- package/docs/components/color-area/content.md +86 -0
- package/docs/components/color-field/content.md +134 -0
- package/docs/components/color-picker/content.md +208 -0
- package/docs/components/color-slider/content.md +120 -0
- package/docs/components/color-swatch/content.md +64 -0
- package/docs/components/color-swatch-picker/content.md +126 -0
- package/docs/components/content.md +97 -0
- package/docs/components/currency-input/content.md +205 -0
- package/docs/components/data-grid/content.md +522 -0
- package/docs/components/date-field/content.md +147 -0
- package/docs/components/date-picker/content.md +360 -0
- package/docs/components/date-range-picker/content.md +301 -0
- package/docs/components/date-time-field/content.md +157 -0
- package/docs/components/date-time-list/content.md +105 -0
- package/docs/components/date-time-picker/content.md +272 -0
- package/docs/components/dialog/content.md +436 -0
- package/docs/components/dialog/design.md +192 -0
- package/docs/components/divider/content.md +112 -0
- package/docs/components/drawer/content.md +436 -0
- package/docs/components/field/content.md +277 -0
- package/docs/components/form/content.md +62 -0
- package/docs/components/full-screen-dialog/content.md +881 -0
- package/docs/components/heading/content.md +55 -0
- package/docs/components/icon/content.md +190 -0
- package/docs/components/icon-button/content.md +200 -0
- package/docs/components/icon-button/design.md +165 -0
- package/docs/components/image/content.md +104 -0
- package/docs/components/input/content.md +281 -0
- package/docs/components/input/design.md +389 -0
- package/docs/components/insurance-disclosure/content.md +103 -0
- package/docs/components/link/content.md +180 -0
- package/docs/components/link/design.md +160 -0
- package/docs/components/list-item/content.md +695 -0
- package/docs/components/menu/content.md +1247 -0
- package/docs/components/month-calendar/content.md +84 -0
- package/docs/components/month-picker/content.md +273 -0
- package/docs/components/otp-input/content.md +327 -0
- package/docs/components/progress-bar/content.md +87 -0
- package/docs/components/progress-circle/content.md +176 -0
- package/docs/components/progress-segmented/content.md +119 -0
- package/docs/components/quick-action-button/content.md +154 -0
- package/docs/components/quick-action-button/design.md +170 -0
- package/docs/components/radio/content.md +224 -0
- package/docs/components/range-calendar/content.md +123 -0
- package/docs/components/reorderable-list/content.md +309 -0
- package/docs/components/scoped-theme/content.md +47 -0
- package/docs/components/scroll-shadow/content.md +686 -0
- package/docs/components/select/content.md +400 -0
- package/docs/components/select/design.md +301 -0
- package/docs/components/skeleton/content.md +103 -0
- package/docs/components/slider/content.md +423 -0
- package/docs/components/stack/content.md +161 -0
- package/docs/components/switch/content.md +150 -0
- package/docs/components/switch/design.md +208 -0
- package/docs/components/table/content.md +548 -0
- package/docs/components/table-pagination/content.md +177 -0
- package/docs/components/tabs/content.md +292 -0
- package/docs/components/text/content.md +142 -0
- package/docs/components/textarea/content.md +222 -0
- package/docs/components/tile/content.md +703 -0
- package/docs/components/toast/content.md +456 -0
- package/docs/components/toggle-button/content.md +505 -0
- package/docs/components/tooltip/content.md +350 -0
- package/docs/components/virtualized-list/content.md +250 -0
- package/docs/foundations/content.md +9 -0
- package/docs/foundations/expressions/icons/content.md +19 -0
- package/docs/foundations/styles/tokens/all-tokens/content.md +192 -0
- package/docs/foundations/styles/tokens/what-are-tokens/content.md +33 -0
- package/docs/foundations/styles/tokens/what-are-tokens/design.md +33 -0
- package/docs/getting-started/content.md +4 -0
- package/docs/getting-started/designers/content.md +13 -0
- package/docs/getting-started/designers/design.md +13 -0
- package/docs/getting-started/developers/accessibility/content.md +31 -0
- package/docs/getting-started/developers/content.md +612 -0
- package/docs/getting-started/developers/styling/content.md +193 -0
- package/docs/llms.txt +193 -0
- package/docs/patterns/account-management/content.md +75 -0
- package/docs/patterns/authentication/content.md +52 -0
- package/docs/patterns/content.md +10 -0
- package/docs/patterns/dashboard/content.md +39 -0
- package/docs/patterns/empty-states/content.md +31 -0
- package/docs/patterns/forms/content.md +109 -0
- package/docs/patterns/onboarding/content.md +69 -0
- package/docs/patterns/payments/content.md +35 -0
- package/docs/patterns/settings/content.md +72 -0
- package/docs/resources/content.md +9 -0
- package/docs/resources/figma-libraries/content.md +42 -0
- package/docs/resources/release-notes/0.0.1-beta.118/content.md +27 -0
- package/docs/resources/release-notes/0.0.1-beta.122/content.md +21 -0
- package/docs/resources/release-notes/0.0.1-beta.124/content.md +16 -0
- package/docs/resources/release-notes/0.0.1-beta.126/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.127/content.md +14 -0
- package/docs/resources/release-notes/0.0.1-beta.128/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.129/content.md +18 -0
- package/docs/resources/release-notes/0.0.1-beta.130/content.md +18 -0
- package/docs/resources/release-notes/0.0.1-beta.133/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.134/content.md +17 -0
- package/docs/resources/release-notes/0.0.1-beta.136/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.137/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.138/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.139/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.140/content.md +26 -0
- package/docs/resources/release-notes/0.0.1-beta.141/content.md +63 -0
- package/docs/resources/release-notes/0.0.1-beta.142/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.143/content.md +12 -0
- package/docs/resources/release-notes/0.0.1-beta.144/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.145/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.147/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.149/content.md +10 -0
- package/docs/resources/release-notes/0.0.1-beta.150/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.152/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.154/content.md +15 -0
- package/docs/resources/release-notes/0.0.1-beta.156/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.158/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.159/content.md +11 -0
- package/docs/resources/release-notes/0.0.1-beta.160/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.161/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.163/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.164/content.md +9 -0
- package/docs/resources/release-notes/0.0.1-beta.166/content.md +17 -0
- package/docs/resources/release-notes/0.0.1-beta.167/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.168/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.169/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.171/content.md +16 -0
- package/docs/resources/release-notes/0.0.1-beta.172/content.md +24 -0
- package/docs/resources/release-notes/0.0.1-beta.173/content.md +15 -0
- package/docs/resources/release-notes/0.0.1-beta.174/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.176/content.md +32 -0
- package/docs/resources/release-notes/0.0.1-beta.179/content.md +11 -0
- package/docs/resources/release-notes/0.0.1-beta.182/content.md +13 -0
- package/docs/resources/release-notes/0.0.1-beta.185/content.md +7 -0
- package/docs/resources/release-notes/0.0.1-beta.187/content.md +27 -0
- package/docs/resources/release-notes/0.1.1/content.md +23 -0
- package/docs/resources/release-notes/0.1.2/content.md +7 -0
- package/docs/resources/release-notes/0.1.4/content.md +19 -0
- package/docs/resources/release-notes/0.1.5/content.md +7 -0
- package/docs/resources/release-notes/0.1.6/content.md +7 -0
- package/docs/resources/release-notes/0.2.0/content.md +31 -0
- package/docs/resources/release-notes/0.2.1/content.md +17 -0
- package/docs/resources/release-notes/0.2.2/content.md +11 -0
- package/docs/resources/release-notes/0.2.3/content.md +15 -0
- package/docs/resources/release-notes/content.md +64 -0
- package/lib/commonjs/components/DateTimeList/index.js +11 -26
- package/lib/commonjs/components/DateTimeList/index.js.map +1 -1
- package/lib/commonjs/components/DateTimeList/styles.js +2 -12
- package/lib/commonjs/components/DateTimeList/styles.js.map +1 -1
- package/lib/commonjs/components/ListItem/index.js.map +1 -1
- package/lib/commonjs/components/ListItem/styles.js +2 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +11 -5
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/gradient.js +29 -0
- package/lib/commonjs/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/index.js +171 -44
- package/lib/commonjs/components/ScrollShadow/index.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/styles.js +58 -14
- package/lib/commonjs/components/ScrollShadow/styles.js.map +1 -1
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js +63 -0
- package/lib/commonjs/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +48 -8
- package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/commonjs/components/Tabs/index.js +16 -23
- package/lib/commonjs/components/Tabs/index.js.map +1 -1
- package/lib/commonjs/components/Tabs/styles.js +1 -10
- package/lib/commonjs/components/Tabs/styles.js.map +1 -1
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/commonjs/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/module/components/DateTimeList/index.js +12 -27
- package/lib/module/components/DateTimeList/index.js.map +1 -1
- package/lib/module/components/DateTimeList/styles.js +1 -11
- package/lib/module/components/DateTimeList/styles.js.map +1 -1
- package/lib/module/components/ListItem/index.js.map +1 -1
- package/lib/module/components/ListItem/styles.js +2 -1
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/components/Menu/index.js +11 -5
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/gradient.js +24 -0
- package/lib/module/components/ScrollShadow/gradient.js.map +1 -0
- package/lib/module/components/ScrollShadow/index.js +170 -48
- package/lib/module/components/ScrollShadow/index.js.map +1 -1
- package/lib/module/components/ScrollShadow/styles.js +57 -13
- package/lib/module/components/ScrollShadow/styles.js.map +1 -1
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js +57 -0
- package/lib/module/components/ScrollShadow/useComposedScrollHandler.js.map +1 -0
- package/lib/module/components/ScrollShadow/useScrollShadow.js +46 -8
- package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
- package/lib/module/components/Tabs/index.js +17 -24
- package/lib/module/components/Tabs/index.js.map +1 -1
- package/lib/module/components/Tabs/styles.js +0 -9
- package/lib/module/components/Tabs/styles.js.map +1 -1
- package/lib/module/figma/ListItem.SectionHeader.figma.js +20 -5
- package/lib/module/figma/ListItem.SectionHeader.figma.js.map +1 -1
- package/lib/typescript/components/DateTimeList/index.d.ts.map +1 -1
- package/lib/typescript/components/DateTimeList/styles.d.ts +1 -4
- package/lib/typescript/components/DateTimeList/styles.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +5 -4
- package/lib/typescript/components/ListItem/index.d.ts.map +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts +1 -1
- package/lib/typescript/components/ListItem/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/gradient.d.ts +7 -0
- package/lib/typescript/components/ScrollShadow/gradient.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/index.d.ts +57 -15
- package/lib/typescript/components/ScrollShadow/index.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/styles.d.ts +8 -2
- package/lib/typescript/components/ScrollShadow/styles.d.ts.map +1 -1
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts +13 -0
- package/lib/typescript/components/ScrollShadow/useComposedScrollHandler.d.ts.map +1 -0
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts +15 -2
- package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/styles.d.ts +0 -7
- package/lib/typescript/components/Tabs/styles.d.ts.map +1 -1
- package/lib/typescript/figma/ListItem.SectionHeader.figma.d.ts.map +1 -1
- package/package.json +8 -6
- package/src/components/DateTimeList/index.tsx +13 -26
- package/src/components/DateTimeList/styles.ts +1 -10
- package/src/components/ListItem/index.tsx +5 -4
- package/src/components/ListItem/styles.ts +1 -0
- package/src/components/Menu/index.tsx +11 -8
- package/src/components/ScrollShadow/gradient.ts +48 -0
- package/src/components/ScrollShadow/index.tsx +300 -69
- package/src/components/ScrollShadow/styles.ts +45 -28
- package/src/components/ScrollShadow/useComposedScrollHandler.ts +58 -0
- package/src/components/ScrollShadow/useScrollShadow.ts +72 -10
- package/src/components/Tabs/index.tsx +25 -35
- package/src/components/Tabs/styles.ts +0 -9
|
@@ -1,29 +1,71 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type ViewStyle } from 'react-native';
|
|
3
|
-
import { type ScrollShadowVariantProps } from './styles';
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type ScrollShadowSize, type ScrollShadowSurface, type ScrollShadowVariantProps } from './styles';
|
|
4
4
|
import { type ScrollShadowCapability } from './useScrollShadow';
|
|
5
|
-
export type { ScrollShadowCapability };
|
|
5
|
+
export type { ScrollShadowCapability, UseScrollShadowOptions, UseScrollShadowReturn, } from './useScrollShadow';
|
|
6
|
+
export { useScrollShadow } from './useScrollShadow';
|
|
7
|
+
export type ScrollShadowVisibility = 'auto' | 'both' | 'start' | 'end' | 'none';
|
|
6
8
|
export interface ScrollShadowProps extends ScrollShadowVariantProps {
|
|
7
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The scroll view to decorate: a `ScrollView`, `FlatList`, or `VirtualizedList`, passed as
|
|
11
|
+
* the direct child. With a forced `visibility`, any single view works.
|
|
12
|
+
*/
|
|
13
|
+
children: ReactElement;
|
|
14
|
+
/** Classes for the wrapping view, for example `h-full` or `flex-1` to bound the scroller. */
|
|
8
15
|
className?: string;
|
|
16
|
+
/** Style for the wrapping view. */
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
/**
|
|
19
|
+
* Scroll axis that gets fades.
|
|
20
|
+
* @default inferred from the child's `horizontal` prop, otherwise `'vertical'`
|
|
21
|
+
*/
|
|
22
|
+
orientation?: 'horizontal' | 'vertical';
|
|
9
23
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @default 'from-background/35'
|
|
24
|
+
* Theme surface the fade blends into. Match it to the background behind the scroller.
|
|
25
|
+
* @default 'background'
|
|
13
26
|
*/
|
|
14
|
-
|
|
27
|
+
surface?: ScrollShadowSurface;
|
|
15
28
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @default
|
|
29
|
+
* Fade depth along the scroll axis: `small` is 32px, `default` is 40px, `large` is 72px.
|
|
30
|
+
* @default 'default'
|
|
18
31
|
*/
|
|
19
|
-
size?:
|
|
32
|
+
size?: ScrollShadowSize;
|
|
20
33
|
/**
|
|
21
|
-
*
|
|
34
|
+
* Which edges show a fade. `auto` follows the scroll position; `both`, `start`, and `end`
|
|
35
|
+
* force those edges on; `none` hides them.
|
|
36
|
+
* @default 'auto'
|
|
37
|
+
*/
|
|
38
|
+
visibility?: ScrollShadowVisibility;
|
|
39
|
+
/**
|
|
40
|
+
* Pixels of scroll slack before an edge counts as scrollable. Only used with `auto`.
|
|
22
41
|
* @default 0
|
|
23
42
|
*/
|
|
24
43
|
offset?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Hides the child's scrollbar on web. On iOS and Android, set
|
|
46
|
+
* `showsVerticalScrollIndicator` or `showsHorizontalScrollIndicator` on the child instead.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
hideScrollBar?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Width, opacity, or position overrides for the fade overlays, applied after `size`, for
|
|
52
|
+
* example `w-24` or `opacity-85`. Must not carry color classes; use `surface` or
|
|
53
|
+
* `colorClassName` instead.
|
|
54
|
+
*/
|
|
55
|
+
edgeClassName?: string;
|
|
56
|
+
/**
|
|
57
|
+
* One-off fade color outside the `surface` options, as an `accent-*` class. Overrides
|
|
58
|
+
* `surface` on every platform and follows dark mode and `ScopedTheme`.
|
|
59
|
+
*/
|
|
60
|
+
colorClassName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Called when either edge starts or stops being scrollable, with
|
|
63
|
+
* `{ canScrollBefore, canScrollAfter }`. Only fires with `visibility="auto"`.
|
|
64
|
+
*/
|
|
25
65
|
onCapabilityChange?: (capability: ScrollShadowCapability) => void;
|
|
26
|
-
style?: ViewStyle;
|
|
27
66
|
}
|
|
28
|
-
export declare function ScrollShadow({ children, className,
|
|
67
|
+
export declare function ScrollShadow({ children, className, style, surface, size, visibility, hideScrollBar, orientation, offset, edgeClassName, colorClassName, onCapabilityChange, }: ScrollShadowProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare namespace ScrollShadow {
|
|
69
|
+
var displayName: string;
|
|
70
|
+
}
|
|
29
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,EAAwC,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpG,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAMlB,OAAO,EAEL,KAAK,sBAAsB,EAG5B,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEhF,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE;;;OAGG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACnE;AAwID,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,KAAK,EACL,OAAsB,EACtB,IAAgB,EAChB,UAAmB,EACnB,aAAqB,EACrB,WAAW,EACX,MAAU,EACV,aAAa,EACb,cAAc,EACd,kBAAkB,GACnB,EAAE,iBAAiB,2CAgGnB;yBA7Ge,YAAY"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { type VariantProps } from '@cdx-ui/utils';
|
|
2
|
+
export type ScrollShadowSurface = 'background' | 'primary' | 'secondary';
|
|
3
|
+
export type ScrollShadowSize = 'small' | 'default' | 'large';
|
|
4
|
+
export declare const SCROLL_SHADOW_SURFACE_CSS_VARS: Record<ScrollShadowSurface, string>;
|
|
5
|
+
export declare const SCROLL_SHADOW_SIZE_PX: Record<ScrollShadowSize, number>;
|
|
6
|
+
export declare const SCROLL_SHADOW_SURFACE_FROM_CLASS: Record<ScrollShadowSurface, string>;
|
|
2
7
|
export declare const scrollShadowVariants: (props?: ({
|
|
3
|
-
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
4
8
|
hideScrollBar?: boolean | null | undefined;
|
|
5
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
10
|
export declare const scrollShadowContainerVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
-
export declare const
|
|
11
|
+
export declare const scrollShadowEdgeVariants: (props?: ({
|
|
8
12
|
orientation?: "vertical" | "horizontal" | null | undefined;
|
|
9
13
|
edge?: "end" | "start" | null | undefined;
|
|
14
|
+
size?: "small" | "default" | "large" | null | undefined;
|
|
10
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
16
|
export type ScrollShadowVariantProps = VariantProps<typeof scrollShadowVariants>;
|
|
17
|
+
export type ScrollShadowEdgeVariantProps = VariantProps<typeof scrollShadowEdgeVariants>;
|
|
12
18
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7D,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAI9E,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAIlE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAIhF,CAAC;AAEF,eAAO,MAAM,oBAAoB;;8EAU/B,CAAC;AAEH,eAAO,MAAM,6BAA6B,oFAAiC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;8EAiCnC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACjF,MAAM,MAAM,4BAA4B,GAAG,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
type ScrollHandler = (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
3
|
+
export declare function isReanimatedScrollHandler(handler: unknown): boolean;
|
|
4
|
+
export declare function composeScrollHandler(internalHandler: ScrollHandler, externalHandler: unknown): ScrollHandler;
|
|
5
|
+
/**
|
|
6
|
+
* Only call this when the child already passed a Reanimated scroll handler.
|
|
7
|
+
* `useAnimatedScrollHandler` requires a Babel worklet, and the published
|
|
8
|
+
* package is not transformed by that plugin, so the plain ScrollView path
|
|
9
|
+
* must not mount this hook.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useReanimatedComposedScrollHandler(internalHandler: ScrollHandler, externalHandler: unknown): unknown;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=useComposedScrollHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useComposedScrollHandler.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/useComposedScrollHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAK5E,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;AAE9E,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEnE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,aAAa,EAC9B,eAAe,EAAE,OAAO,GACvB,aAAa,CAMf;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,eAAe,EAAE,aAAa,EAC9B,eAAe,EAAE,OAAO,GACvB,OAAO,CAyBT"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
1
2
|
import type { LayoutChangeEvent, NativeScrollEvent, NativeSyntheticEvent } from 'react-native';
|
|
2
3
|
export interface ScrollShadowCapability {
|
|
3
4
|
canScrollBefore: boolean;
|
|
@@ -6,12 +7,24 @@ export interface ScrollShadowCapability {
|
|
|
6
7
|
export interface UseScrollShadowOptions {
|
|
7
8
|
orientation?: 'horizontal' | 'vertical';
|
|
8
9
|
offset?: number;
|
|
10
|
+
enabled?: boolean;
|
|
9
11
|
onCapabilityChange?: (capability: ScrollShadowCapability) => void;
|
|
10
12
|
}
|
|
11
|
-
export
|
|
13
|
+
export interface UseScrollShadowReturn {
|
|
12
14
|
capability: ScrollShadowCapability;
|
|
13
15
|
handleLayout: (event: LayoutChangeEvent) => void;
|
|
14
16
|
handleContentSizeChange: (width: number, height: number) => void;
|
|
15
17
|
handleScroll: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
16
|
-
}
|
|
18
|
+
}
|
|
19
|
+
export interface ScrollShadowDistance {
|
|
20
|
+
before: number;
|
|
21
|
+
after: number;
|
|
22
|
+
}
|
|
23
|
+
interface ScrollShadowTrackerOptions extends UseScrollShadowOptions {
|
|
24
|
+
onDistanceChange?: (distance: ScrollShadowDistance) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function normalizeAxisScrollOffset(rawOffset: number, orientation: 'horizontal' | 'vertical', maxOffset: number, platform?: typeof Platform.OS): number;
|
|
27
|
+
export declare function useScrollShadow(options?: UseScrollShadowOptions): UseScrollShadowReturn;
|
|
28
|
+
export declare function useScrollShadowTracker({ orientation, offset, enabled, onCapabilityChange, onDistanceChange, }?: ScrollShadowTrackerOptions): UseScrollShadowReturn;
|
|
29
|
+
export {};
|
|
17
30
|
//# sourceMappingURL=useScrollShadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollShadow.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/useScrollShadow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE/F,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACnE;
|
|
1
|
+
{"version":3,"file":"useScrollShadow.d.ts","sourceRoot":"","sources":["../../../../src/components/ScrollShadow/useScrollShadow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE/F,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,sBAAsB,KAAK,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,sBAAsB,CAAC;IACnC,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IACjD,uBAAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,YAAY,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACxE;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,0BAA2B,SAAQ,sBAAsB;IACjE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC7D;AAcD,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,YAAY,GAAG,UAAU,EACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,OAAO,QAAQ,CAAC,EAAgB,GACzC,MAAM,CAOR;AA4BD,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,qBAAqB,CAE3F;AAED,wBAAgB,sBAAsB,CAAC,EACrC,WAAwB,EACxB,MAAU,EACV,OAAc,EACd,kBAAkB,EAClB,gBAAgB,GACjB,GAAE,0BAA+B,GAAG,qBAAqB,CA6EzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,IAAI,EACJ,IAAI,EAEJ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAKL,IAAI,EACJ,IAAI,EAEJ,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAUL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAmBL,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,CAAC;AAqD5B,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,UAAU;IACxE,iKAAiK;IACjK,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,QAAQ,4FAkBb,CAAC;AAQF,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED,QAAA,MAAM,QAAQ,gGAmYb,CAAC;AAQF,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,OAAO,+FAyCZ,CAAC;AAQF,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,oGAoBjB,CAAC;AAQF,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,SAAS,iGAiBd,CAAC;AAQF,KAAK,qBAAqB,GAAG,OAAO,QAAQ,GAAG;IAC7C,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,GAAG,EAAE,OAAO,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,KAAK,EAAE,OAAO,SAAS,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,IAAI,EAKX,qBAAqB,CAAC"}
|
|
@@ -8,13 +8,6 @@ export declare const OUTLINE_INDICATOR_THICKNESS = 2;
|
|
|
8
8
|
* ahead of a still-sliding solid/outline indicator. Change both together.
|
|
9
9
|
*/
|
|
10
10
|
export declare const TABS_INDICATOR_TRANSITION_MS = 150;
|
|
11
|
-
/** Outline horizontal scroll — narrow fade reads cleanly against the page background. */
|
|
12
|
-
export declare const TABS_SCROLL_FADE_SIZE = 32;
|
|
13
|
-
/**
|
|
14
|
-
* Solid horizontal scroll — wider fade so tabs dissolve smoothly into the track (and under the
|
|
15
|
-
* overlay chevron) instead of ending in a hard clip at the scroll viewport edge.
|
|
16
|
-
*/
|
|
17
|
-
export declare const TABS_SOLID_SCROLL_FADE_SIZE = 40;
|
|
18
11
|
/**
|
|
19
12
|
* Numeric styles that can't be expressed as static Uniwind utility classes — solid track radius
|
|
20
13
|
* and outline indicator offset (`bottom-px` / `left-px` don't apply on Reanimated host views).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKvD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAuB9C,kGAAkG;AAClG,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Tabs/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAKvD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAuB9C,kGAAkG;AAClG,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAqBhD;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;IAIrB,kGAAkG;;;;IAIlG,sGAAsG;;;;;;;;;;;;;;;;;;;;;;;;IAwBtG,6GAA6G;;;;;CAK7G,CAAC;AAEH,eAAO,MAAM,gBAAgB;;8EAQ3B,CAAC;AAEH,eAAO,MAAM,gBAAgB,oFAA4B,CAAC;AAE1D,mEAAmE;AACnE,eAAO,MAAM,qBAAqB;;;;8EAkChC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,oFAErC,CAAC;AAEH,eAAO,MAAM,4BAA4B,oFAAiD,CAAC;AAE3F,eAAO,MAAM,0BAA0B,oFAA6B,CAAC;AAErE,eAAO,MAAM,+BAA+B,oFAAmC,CAAC;AAGhF,eAAO,MAAM,4BAA4B,oFAOvC,CAAC;AAIH,eAAO,MAAM,iCAAiC,oFAO5C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;8EAUjD,CAAC;AAIF,eAAO,MAAM,wBAAwB;;8EAQnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;8EA0BhC,CAAC;AAEH,eAAO,MAAM,eAAe;;;8EAuD3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;8EAQ5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;8EAiB/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,OAAO,eAAe,CAAC,CAAC;AACvE,MAAM,MAAM,yBAAyB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.SectionHeader.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ListItem.SectionHeader.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"ListItem.SectionHeader.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ListItem.SectionHeader.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AA6B1B,wBAIE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
"lib",
|
|
34
34
|
"src",
|
|
35
35
|
"!src/figma",
|
|
36
|
-
"coverage.svg"
|
|
36
|
+
"coverage.svg",
|
|
37
|
+
"docs",
|
|
38
|
+
"AGENTS.md"
|
|
37
39
|
],
|
|
38
40
|
"react-native-builder-bob": {
|
|
39
41
|
"source": "src",
|
|
@@ -104,10 +106,10 @@
|
|
|
104
106
|
"@marceloterreiro/flash-calendar": "2.0.0",
|
|
105
107
|
"react-native-reanimated-carousel": "5.0.0-beta.5",
|
|
106
108
|
"uniwind": "1.10.0",
|
|
107
|
-
"@cdx-ui/formatters": "0.2.
|
|
108
|
-
"@cdx-ui/
|
|
109
|
-
"@cdx-ui/icons": "0.2.
|
|
110
|
-
"@cdx-ui/
|
|
109
|
+
"@cdx-ui/formatters": "0.2.4",
|
|
110
|
+
"@cdx-ui/primitives": "0.2.4",
|
|
111
|
+
"@cdx-ui/icons": "0.2.4",
|
|
112
|
+
"@cdx-ui/utils": "0.2.4"
|
|
111
113
|
},
|
|
112
114
|
"devDependencies": {
|
|
113
115
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { forwardRef, type ReactNode } from 'react';
|
|
2
2
|
import { Pressable, Text, View, type ViewProps } from 'react-native';
|
|
3
|
-
import { useCSSVariable } from 'uniwind';
|
|
4
3
|
import {
|
|
5
4
|
dataAttributes,
|
|
6
5
|
DATE_TIME_LIST_HEIGHT,
|
|
@@ -15,10 +14,11 @@ import {
|
|
|
15
14
|
} from '@cdx-ui/primitives';
|
|
16
15
|
import { getDateTimeSegmentVisibility } from '@cdx-ui/formatters';
|
|
17
16
|
import { cn } from '@cdx-ui/utils';
|
|
17
|
+
import { ScrollShadow } from '../ScrollShadow';
|
|
18
18
|
import {
|
|
19
19
|
dateTimeListColumnsVariants,
|
|
20
20
|
dateTimeListColumnVariants,
|
|
21
|
-
|
|
21
|
+
dateTimeListFadeLayerVariants,
|
|
22
22
|
dateTimeListHighlightVariants,
|
|
23
23
|
dateTimeListOptionTextVariants,
|
|
24
24
|
dateTimeListOptionVariants,
|
|
@@ -50,24 +50,6 @@ function DateTimeListDefaultBody() {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/** Cross-platform edge fade (Uniwind gradients are unreliable on native). */
|
|
54
|
-
function EdgeFade({ edge }: { edge: 'top' | 'bottom' }) {
|
|
55
|
-
const surface = useCSSVariable('--color-surface-primary') || 'transparent';
|
|
56
|
-
const isTop = edge === 'top';
|
|
57
|
-
return (
|
|
58
|
-
<View
|
|
59
|
-
pointerEvents="none"
|
|
60
|
-
className={dateTimeListEdgeFadeVariants({ edge })}
|
|
61
|
-
style={{
|
|
62
|
-
height: DATE_TIME_LIST_ITEM_HEIGHT * 1.75,
|
|
63
|
-
experimental_backgroundImage: isTop
|
|
64
|
-
? `linear-gradient(to bottom, ${surface as string}, transparent)`
|
|
65
|
-
: `linear-gradient(to top, ${surface as string}, transparent)`,
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
53
|
const DateTimeListRoot = forwardRef<View, DateTimeListProps>(
|
|
72
54
|
({ className, children, style, ...props }, ref) => (
|
|
73
55
|
<DateTimeListRootPrimitive
|
|
@@ -86,12 +68,17 @@ const DateTimeListRoot = forwardRef<View, DateTimeListProps>(
|
|
|
86
68
|
}}
|
|
87
69
|
/>
|
|
88
70
|
|
|
89
|
-
<
|
|
90
|
-
{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
71
|
+
<ScrollShadow
|
|
72
|
+
className={dateTimeListFadeLayerVariants()}
|
|
73
|
+
orientation="vertical"
|
|
74
|
+
size="large"
|
|
75
|
+
surface="primary"
|
|
76
|
+
visibility="both"
|
|
77
|
+
>
|
|
78
|
+
<View className={dateTimeListColumnsVariants()}>
|
|
79
|
+
{children ?? <DateTimeListDefaultBody />}
|
|
80
|
+
</View>
|
|
81
|
+
</ScrollShadow>
|
|
95
82
|
</DateTimeListRootPrimitive>
|
|
96
83
|
),
|
|
97
84
|
);
|
|
@@ -45,15 +45,6 @@ export const dateTimeListOptionTextVariants = cva('body-md tabular-nums', {
|
|
|
45
45
|
defaultVariants: { selected: false },
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
export const
|
|
49
|
-
variants: {
|
|
50
|
-
edge: {
|
|
51
|
-
top: 'top-0',
|
|
52
|
-
bottom: 'bottom-0',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
defaultVariants: { edge: 'top' },
|
|
56
|
-
});
|
|
48
|
+
export const dateTimeListFadeLayerVariants = cva(['h-full', LAYER_EDGE_FADE]);
|
|
57
49
|
|
|
58
50
|
export type DateTimeListColumnVariantProps = VariantProps<typeof dateTimeListColumnVariants>;
|
|
59
|
-
export type DateTimeListEdgeFadeVariantProps = VariantProps<typeof dateTimeListEdgeFadeVariants>;
|
|
@@ -522,11 +522,12 @@ export interface ListItemSectionHeaderProps extends ViewProps {
|
|
|
522
522
|
trailing?: ReactNode;
|
|
523
523
|
/**
|
|
524
524
|
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a neutral fill
|
|
525
|
-
* (matching `subtle` on Avatar, Chip, and IconButton) and drops the bottom border.
|
|
526
|
-
*
|
|
525
|
+
* (matching `subtle` on Avatar, Chip, and IconButton) and drops the bottom border. `gradient`
|
|
526
|
+
* fades from the primary surface into a brand tint, left to right, and keeps the bottom border.
|
|
527
|
+
* Label typography is the same for all three.
|
|
527
528
|
* @default 'ghost'
|
|
528
|
-
* @remarks `'ghost' | 'subtle'`
|
|
529
|
-
* @fumadocsType `'ghost' | 'subtle'`
|
|
529
|
+
* @remarks `'ghost' | 'subtle' | 'gradient'`
|
|
530
|
+
* @fumadocsType `'ghost' | 'subtle' | 'gradient'`
|
|
530
531
|
*/
|
|
531
532
|
variant?: ListItemSectionHeaderVariant;
|
|
532
533
|
/**
|
|
@@ -154,6 +154,7 @@ export const listItemSectionHeaderVariants = cva(
|
|
|
154
154
|
ghost: [],
|
|
155
155
|
// The fill separates the header from its rows, so the bottom border is dropped.
|
|
156
156
|
subtle: 'bg-surface-neutral-subtle border-b-0',
|
|
157
|
+
gradient: 'bg-gradient-to-r from-surface-primary to-surface-brand-tint',
|
|
157
158
|
},
|
|
158
159
|
showDivider: {
|
|
159
160
|
true: ['border-t-4 border-solid border-t-surface-brand-strong/40', 'border-x-0'],
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
type IMenuTriggerProps,
|
|
36
36
|
} from '@cdx-ui/primitives';
|
|
37
37
|
import { cn, ParentContext, useParentContext, useStyleContext } from '@cdx-ui/utils';
|
|
38
|
+
import { ScrollShadow } from '../ScrollShadow';
|
|
38
39
|
import { Icon, type IconProps } from '../Icon';
|
|
39
40
|
import { checkboxIconVariants, checkboxIndicatorVariants } from '../Checkbox/styles';
|
|
40
41
|
import { radioIndicatorVariants, radioInnerDotVariants } from '../Radio/styles';
|
|
@@ -222,14 +223,16 @@ const MenuContent = forwardRef<View, MenuContentProps>(
|
|
|
222
223
|
: mergeDataAttributes(props, dataAttributes({ slot: 'menu-content' }));
|
|
223
224
|
|
|
224
225
|
const content = shouldScroll ? (
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
<ScrollShadow className="shrink" style={constrainedStyle} surface="primary">
|
|
227
|
+
<ScrollView
|
|
228
|
+
className="shrink"
|
|
229
|
+
style={[MENU_SCROLL_STYLE, constrainedStyle]}
|
|
230
|
+
scrollEventThrottle={16}
|
|
231
|
+
nestedScrollEnabled
|
|
232
|
+
>
|
|
233
|
+
{children}
|
|
234
|
+
</ScrollView>
|
|
235
|
+
</ScrollShadow>
|
|
233
236
|
) : (
|
|
234
237
|
children
|
|
235
238
|
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { I18nManager } from 'react-native';
|
|
2
|
+
import { SCROLL_SHADOW_SURFACE_FROM_CLASS, type ScrollShadowSurface } from './styles';
|
|
3
|
+
|
|
4
|
+
type ScrollShadowEdge = 'start' | 'end';
|
|
5
|
+
type ScrollShadowOrientation = 'horizontal' | 'vertical';
|
|
6
|
+
|
|
7
|
+
export function getWebSurfaceGradientClasses(
|
|
8
|
+
surface: ScrollShadowSurface,
|
|
9
|
+
orientation: ScrollShadowOrientation,
|
|
10
|
+
edge: ScrollShadowEdge,
|
|
11
|
+
): string {
|
|
12
|
+
const fromClass = SCROLL_SHADOW_SURFACE_FROM_CLASS[surface];
|
|
13
|
+
|
|
14
|
+
if (orientation === 'vertical') {
|
|
15
|
+
return edge === 'start'
|
|
16
|
+
? `bg-gradient-to-b ${fromClass} to-transparent`
|
|
17
|
+
: `bg-gradient-to-t ${fromClass} to-transparent`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ltr:/rtl: so the fade flips with layout direction on the first paint,
|
|
21
|
+
// not after a later scroll re-render.
|
|
22
|
+
return edge === 'start'
|
|
23
|
+
? `ltr:bg-gradient-to-r rtl:bg-gradient-to-l ${fromClass} to-transparent`
|
|
24
|
+
: `ltr:bg-gradient-to-l rtl:bg-gradient-to-r ${fromClass} to-transparent`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getInlineBackgroundImage(
|
|
28
|
+
color: string,
|
|
29
|
+
orientation: ScrollShadowOrientation,
|
|
30
|
+
edge: ScrollShadowEdge,
|
|
31
|
+
isRTL = I18nManager.isRTL,
|
|
32
|
+
): string {
|
|
33
|
+
if (orientation === 'vertical') {
|
|
34
|
+
return edge === 'start'
|
|
35
|
+
? `linear-gradient(to bottom, ${color}, transparent)`
|
|
36
|
+
: `linear-gradient(to top, ${color}, transparent)`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (isRTL) {
|
|
40
|
+
return edge === 'start'
|
|
41
|
+
? `linear-gradient(to left, ${color}, transparent)`
|
|
42
|
+
: `linear-gradient(to right, ${color}, transparent)`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return edge === 'start'
|
|
46
|
+
? `linear-gradient(to right, ${color}, transparent)`
|
|
47
|
+
: `linear-gradient(to left, ${color}, transparent)`;
|
|
48
|
+
}
|