@korsolutions/ui 0.0.59 → 0.0.61
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/dist/module/components/button/variants/ghost.js +59 -0
- package/dist/module/components/button/variants/ghost.js.map +1 -0
- package/dist/module/components/button/variants/index.js +3 -1
- package/dist/module/components/button/variants/index.js.map +1 -1
- package/dist/module/components/icon-button/icon-button.js +63 -0
- package/dist/module/components/icon-button/icon-button.js.map +1 -0
- package/dist/module/components/icon-button/index.js +4 -0
- package/dist/module/components/icon-button/index.js.map +1 -0
- package/dist/module/components/icon-button/types.js +4 -0
- package/dist/module/components/icon-button/types.js.map +1 -0
- package/dist/module/components/icon-button/variants/default.js +34 -0
- package/dist/module/components/icon-button/variants/default.js.map +1 -0
- package/dist/module/components/icon-button/variants/ghost.js +35 -0
- package/dist/module/components/icon-button/variants/ghost.js.map +1 -0
- package/dist/module/components/icon-button/variants/index.js +11 -0
- package/dist/module/components/icon-button/variants/index.js.map +1 -0
- package/dist/module/components/icon-button/variants/secondary.js +37 -0
- package/dist/module/components/icon-button/variants/secondary.js.map +1 -0
- package/dist/module/components/index.js +2 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/components/menu/components/menu-checkbox-item.js +4 -4
- package/dist/module/components/menu/components/menu-checkbox-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-content.js +1 -1
- package/dist/module/components/menu/components/menu-radio-item.js +4 -4
- package/dist/module/components/menu/components/menu-radio-item.js.map +1 -1
- package/dist/module/components/menu/components/menu-selection-indicator.js +29 -0
- package/dist/module/components/menu/components/menu-selection-indicator.js.map +1 -0
- package/dist/module/components/menu/variants/default.js +8 -17
- package/dist/module/components/menu/variants/default.js.map +1 -1
- package/dist/module/components/phone-input/components/country-picker.js +1 -1
- package/dist/module/components/popover/components/popover-content.js +2 -5
- package/dist/module/components/popover/components/popover-content.js.map +1 -1
- package/dist/module/components/portal/index.js +1 -0
- package/dist/module/components/portal/index.js.map +1 -1
- package/dist/module/components/portal/portal-offset.js +32 -0
- package/dist/module/components/portal/portal-offset.js.map +1 -0
- package/dist/module/components/portal/portal.js +39 -17
- package/dist/module/components/portal/portal.js.map +1 -1
- package/dist/module/components/select/components/select-content.js +3 -3
- package/dist/module/components/select/components/select-content.js.map +1 -1
- package/dist/module/components/separator/index.js +4 -0
- package/dist/module/components/separator/index.js.map +1 -0
- package/dist/module/components/separator/separator.js +17 -0
- package/dist/module/components/separator/separator.js.map +1 -0
- package/dist/module/components/separator/types.js +4 -0
- package/dist/module/components/separator/types.js.map +1 -0
- package/dist/module/components/separator/variants/horizontal.js +15 -0
- package/dist/module/components/separator/variants/horizontal.js.map +1 -0
- package/dist/module/components/separator/variants/index.js +9 -0
- package/dist/module/components/separator/variants/index.js.map +1 -0
- package/dist/module/components/separator/variants/vertical.js +15 -0
- package/dist/module/components/separator/variants/vertical.js.map +1 -0
- package/dist/module/components/textarea/variants/default.js +7 -0
- package/dist/module/components/textarea/variants/default.js.map +1 -1
- package/dist/module/hooks/use-relative-position.js +37 -28
- package/dist/module/hooks/use-relative-position.js.map +1 -1
- package/dist/module/themes/provider.js.map +1 -1
- package/dist/typescript/src/components/button/variants/ghost.d.ts +3 -0
- package/dist/typescript/src/components/button/variants/ghost.d.ts.map +1 -0
- package/dist/typescript/src/components/button/variants/index.d.ts +1 -0
- package/dist/typescript/src/components/button/variants/index.d.ts.map +1 -1
- package/dist/typescript/src/components/icon-button/icon-button.d.ts +15 -0
- package/dist/typescript/src/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/index.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/index.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/types.d.ts +8 -0
- package/dist/typescript/src/components/icon-button/types.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/default.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/default.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/ghost.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/ghost.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/index.d.ts +6 -0
- package/dist/typescript/src/components/icon-button/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/icon-button/variants/secondary.d.ts +3 -0
- package/dist/typescript/src/components/icon-button/variants/secondary.d.ts.map +1 -0
- package/dist/typescript/src/components/index.d.ts +2 -0
- package/dist/typescript/src/components/index.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-checkbox-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-radio-item.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts +7 -0
- package/dist/typescript/src/components/menu/components/menu-selection-indicator.d.ts.map +1 -0
- package/dist/typescript/src/components/menu/types.d.ts +1 -3
- package/dist/typescript/src/components/menu/types.d.ts.map +1 -1
- package/dist/typescript/src/components/menu/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/components/popover/components/popover-content.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/index.d.ts +1 -0
- package/dist/typescript/src/components/portal/index.d.ts.map +1 -1
- package/dist/typescript/src/components/portal/portal-offset.d.ts +13 -0
- package/dist/typescript/src/components/portal/portal-offset.d.ts.map +1 -0
- package/dist/typescript/src/components/portal/portal.d.ts +3 -2
- package/dist/typescript/src/components/portal/portal.d.ts.map +1 -1
- package/dist/typescript/src/components/select/components/select-content.d.ts.map +1 -1
- package/dist/typescript/src/components/separator/index.d.ts +3 -0
- package/dist/typescript/src/components/separator/index.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/separator.d.ts +9 -0
- package/dist/typescript/src/components/separator/separator.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/types.d.ts +5 -0
- package/dist/typescript/src/components/separator/types.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/horizontal.d.ts +3 -0
- package/dist/typescript/src/components/separator/variants/horizontal.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/index.d.ts +5 -0
- package/dist/typescript/src/components/separator/variants/index.d.ts.map +1 -0
- package/dist/typescript/src/components/separator/variants/vertical.d.ts +3 -0
- package/dist/typescript/src/components/separator/variants/vertical.d.ts.map +1 -0
- package/dist/typescript/src/components/textarea/variants/default.d.ts.map +1 -1
- package/dist/typescript/src/hooks/use-relative-position.d.ts +4 -7
- package/dist/typescript/src/hooks/use-relative-position.d.ts.map +1 -1
- package/dist/typescript/src/themes/provider.d.ts +3 -0
- package/dist/typescript/src/themes/provider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/button/variants/ghost.tsx +55 -0
- package/src/components/button/variants/index.ts +2 -0
- package/src/components/icon-button/icon-button.tsx +92 -0
- package/src/components/icon-button/index.ts +2 -0
- package/src/components/icon-button/types.ts +9 -0
- package/src/components/icon-button/variants/default.tsx +32 -0
- package/src/components/icon-button/variants/ghost.tsx +33 -0
- package/src/components/icon-button/variants/index.ts +9 -0
- package/src/components/icon-button/variants/secondary.tsx +35 -0
- package/src/components/index.ts +2 -0
- package/src/components/menu/components/menu-checkbox-item.tsx +3 -4
- package/src/components/menu/components/menu-content.tsx +1 -1
- package/src/components/menu/components/menu-radio-item.tsx +3 -7
- package/src/components/menu/components/menu-selection-indicator.tsx +26 -0
- package/src/components/menu/types.ts +1 -6
- package/src/components/menu/variants/default.tsx +7 -16
- package/src/components/phone-input/components/country-picker.tsx +1 -1
- package/src/components/popover/components/popover-content.tsx +1 -4
- package/src/components/portal/index.ts +1 -0
- package/src/components/portal/portal-offset.ts +28 -0
- package/src/components/portal/portal.tsx +54 -22
- package/src/components/select/components/select-content.tsx +14 -5
- package/src/components/separator/index.ts +2 -0
- package/src/components/separator/separator.tsx +15 -0
- package/src/components/separator/types.ts +5 -0
- package/src/components/separator/variants/horizontal.tsx +14 -0
- package/src/components/separator/variants/index.ts +7 -0
- package/src/components/separator/variants/vertical.tsx +14 -0
- package/src/components/textarea/variants/default.tsx +7 -0
- package/src/hooks/use-relative-position.ts +53 -41
- package/src/themes/provider.tsx +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-checkbox-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-checkbox-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"menu-checkbox-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-checkbox-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAWD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA8C5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-radio-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-radio-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"menu-radio-item.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-radio-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;IACxD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAaD,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAgDtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface MenuSelectionIndicatorProps {
|
|
3
|
+
isSelected: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function MenuSelectionIndicator({ isSelected, }: MenuSelectionIndicatorProps): React.JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=menu-selection-indicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-selection-indicator.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/components/menu-selection-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,2BAA2B;IACnC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,GACX,EAAE,2BAA2B,qBAc7B"}
|
|
@@ -5,7 +5,6 @@ import type { MenuOverlayProps } from "./components/menu-overlay";
|
|
|
5
5
|
export type MenuButtonState = "default" | "hovered";
|
|
6
6
|
export type MenuCheckboxItemState = "default" | "hovered" | "disabled";
|
|
7
7
|
export type MenuRadioItemState = "default" | "hovered" | "selected" | "disabled";
|
|
8
|
-
export type MenuRadioIndicatorState = "default" | "selected";
|
|
9
8
|
export interface MenuStyles {
|
|
10
9
|
content?: MenuContentProps["style"];
|
|
11
10
|
item?: Partial<Record<MenuButtonState, StyleProp<ViewStyle>>>;
|
|
@@ -16,10 +15,9 @@ export interface MenuStyles {
|
|
|
16
15
|
label?: StyleProp<TextStyle>;
|
|
17
16
|
separator?: StyleProp<ViewStyle>;
|
|
18
17
|
checkboxItem?: Partial<Record<MenuCheckboxItemState, StyleProp<ViewStyle>>>;
|
|
19
|
-
|
|
18
|
+
selectionIndicator?: TextStyle & SvgProps;
|
|
20
19
|
radioGroup?: StyleProp<ViewStyle>;
|
|
21
20
|
radioItem?: Partial<Record<MenuRadioItemState, StyleProp<ViewStyle>>>;
|
|
22
|
-
radioIndicator?: Partial<Record<MenuRadioIndicatorState, StyleProp<ViewStyle>>>;
|
|
23
21
|
shortcut?: StyleProp<TextStyle>;
|
|
24
22
|
}
|
|
25
23
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,CA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CAAC,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC5E,kBAAkB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC1C,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,qBAAqB,QAAO,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/menu/variants/default.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC,eAAO,MAAM,qBAAqB,QAAO,UAmGxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/popover/components/popover-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"popover-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/popover/components/popover-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC;IAEzD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAyBxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PortalOffset {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export type PortalOffsetValue = PortalOffset | null | undefined;
|
|
6
|
+
export declare const PortalOffsetContext: import("react").Context<PortalOffsetValue>;
|
|
7
|
+
type UsePortalOffsetReturn = {
|
|
8
|
+
value: PortalOffset;
|
|
9
|
+
isLoaded: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function usePortalOffset(): UsePortalOffsetReturn;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=portal-offset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-offset.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal-offset.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;AAIhE,eAAO,MAAM,mBAAmB,4CAA8C,CAAC;AAE/E,KAAK,qBAAqB,GAAG;IAC3B,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,IAAI,qBAAqB,CASvD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { type PortalHostProps, type PortalProps } from "./portal.constants";
|
|
2
|
-
export declare function PortalHost({ name, container, }: PortalHostProps):
|
|
3
|
-
export declare function Portal({ name, hostName, children, }: PortalProps):
|
|
3
|
+
export declare function PortalHost({ name, container, }: PortalHostProps): React.JSX.Element | null;
|
|
4
|
+
export declare function Portal({ name, hostName, children, }: PortalProps): React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=portal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal.d.ts","sourceRoot":"","sources":["../../../../../src/components/portal/portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AA0F5B,wBAAgB,UAAU,CAAC,EACzB,IAA0B,EAC1B,SAAS,GACV,EAAE,eAAe,4BAcjB;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,QAA8B,EAC9B,QAAQ,GACT,EAAE,WAAW,qBAYb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select-content.d.ts","sourceRoot":"","sources":["../../../../../../src/components/select/components/select-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,CAAC;IAE3D,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBAkCtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
+
import { SeparatorVariants } from "./variants";
|
|
4
|
+
export interface SeparatorProps {
|
|
5
|
+
variant?: keyof typeof SeparatorVariants;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
}
|
|
8
|
+
export declare function Separator(props: SeparatorProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/separator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,OAAO,iBAAiB,CAAC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBAK9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/separator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"horizontal.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/horizontal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,6BAA6B,QAAO,eAUhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vertical.d.ts","sourceRoot":"","sources":["../../../../../../src/components/separator/variants/vertical.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,2BAA2B,QAAO,eAU9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/textarea/variants/default.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../../src/components/textarea/variants/default.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,wBAAgB,yBAAyB,IAAI,cAAc,CAwC1D"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { type DisplayMetrics, type LayoutRectangle, type ViewStyle } from "react-native";
|
|
2
|
-
import type
|
|
3
|
-
type UseRelativePositionArgs = Omit<GetContentStyleArgs, "
|
|
4
|
-
|
|
5
|
-
contentLayout: LayoutRectangle | null;
|
|
6
|
-
};
|
|
7
|
-
export declare function useRelativePosition({ align, triggerPosition, contentLayout, alignOffset, insets, sideOffset, preferredSide, }: UseRelativePositionArgs): ViewStyle;
|
|
2
|
+
import { type SafeAreaInsets } from "../safe-area";
|
|
3
|
+
type UseRelativePositionArgs = Omit<GetContentStyleArgs, "dimensions" | "insets">;
|
|
4
|
+
export declare function useRelativePosition({ align, triggerPosition, contentLayout, alignOffset, sideOffset, preferredSide, }: UseRelativePositionArgs): ViewStyle;
|
|
8
5
|
export interface LayoutPosition {
|
|
9
6
|
pageY: number;
|
|
10
7
|
pageX: number;
|
|
@@ -15,7 +12,7 @@ interface GetPositionArgs {
|
|
|
15
12
|
dimensions: DisplayMetrics;
|
|
16
13
|
triggerPosition: LayoutPosition;
|
|
17
14
|
contentLayout: LayoutRectangle;
|
|
18
|
-
insets
|
|
15
|
+
insets: SafeAreaInsets;
|
|
19
16
|
}
|
|
20
17
|
interface GetSidePositionArgs extends GetPositionArgs {
|
|
21
18
|
preferredSide: "top" | "bottom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"use-relative-position.d.ts","sourceRoot":"","sources":["../../../../src/hooks/use-relative-position.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtE,KAAK,uBAAuB,GAAG,IAAI,CACjC,mBAAmB,EACnB,YAAY,GAAG,QAAQ,CACxB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,eAAe,EACf,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,GACd,EAAE,uBAAuB,GAAG,SAAS,CAyDrC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,cAAc,CAAC;IAC3B,eAAe,EAAE,cAAc,CAAC;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,UAAU,mBAAoB,SAAQ,eAAe;IACnD,aAAa,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,cAK9B,CAAC;AAgFF,UAAU,oBAAqB,SAAQ,eAAe;IACpD,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AA0ED,KAAK,mBAAmB,GAAG,eAAe,GACxC,mBAAmB,GACnB,oBAAoB,CAAC"}
|
|
@@ -17,6 +17,9 @@ export interface ComponentsConfig {
|
|
|
17
17
|
toast?: {
|
|
18
18
|
icons?: Partial<Record<keyof typeof ToastVariants, IconComponent>>;
|
|
19
19
|
};
|
|
20
|
+
menu?: {
|
|
21
|
+
selectionIcon?: IconComponent;
|
|
22
|
+
};
|
|
20
23
|
}
|
|
21
24
|
declare const ThemeContext: import("react").Context<ThemeContext | null>;
|
|
22
25
|
export interface ThemeProviderProps extends PropsWithChildren {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","source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AmB,oCAM/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ButtonStyles } from "../..";
|
|
2
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
3
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
4
|
+
|
|
5
|
+
export const useButtonVariantGhost = (): ButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius, fontFamily, fontSize }): ButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
paddingVertical: 12,
|
|
12
|
+
paddingHorizontal: 16,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
gap: 8,
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
backgroundColor: "transparent",
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
opacity: 0.5,
|
|
21
|
+
},
|
|
22
|
+
loading: {
|
|
23
|
+
opacity: 0.5,
|
|
24
|
+
},
|
|
25
|
+
hovered: {
|
|
26
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
default: {
|
|
31
|
+
color: colors.foreground,
|
|
32
|
+
fontSize,
|
|
33
|
+
fontFamily,
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
color: colors.mutedForeground,
|
|
37
|
+
},
|
|
38
|
+
loading: {
|
|
39
|
+
color: colors.mutedForeground,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
spinner: {
|
|
43
|
+
default: {
|
|
44
|
+
color: colors.foreground,
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
color: colors.mutedForeground,
|
|
48
|
+
},
|
|
49
|
+
loading: {
|
|
50
|
+
color: colors.mutedForeground,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useButtonVariantDefault } from "./default";
|
|
2
|
+
import { useButtonVariantGhost } from "./ghost";
|
|
2
3
|
import { useButtonVariantSecondary } from "./secondary";
|
|
3
4
|
|
|
4
5
|
export const ButtonVariants = {
|
|
5
6
|
default: useButtonVariantDefault,
|
|
6
7
|
secondary: useButtonVariantSecondary,
|
|
8
|
+
ghost: useButtonVariantGhost,
|
|
7
9
|
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Pressable,
|
|
4
|
+
type CursorValue,
|
|
5
|
+
type PressableProps,
|
|
6
|
+
type StyleProp,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import type { SvgProps } from "../../types/props.types";
|
|
10
|
+
import type { IconButtonState } from "./types";
|
|
11
|
+
import { IconButtonVariants } from "./variants";
|
|
12
|
+
|
|
13
|
+
export interface IconButtonProps
|
|
14
|
+
extends Omit<PressableProps, "disabled" | "children"> {
|
|
15
|
+
render: (props: SvgProps) => React.ReactNode;
|
|
16
|
+
variant?: keyof typeof IconButtonVariants;
|
|
17
|
+
isDisabled?: boolean;
|
|
18
|
+
size?: number;
|
|
19
|
+
color?: SvgProps["color"];
|
|
20
|
+
strokeWidth?: number;
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const calculateState = (
|
|
25
|
+
props: IconButtonProps,
|
|
26
|
+
isHovered: boolean,
|
|
27
|
+
): IconButtonState => {
|
|
28
|
+
if (props.isDisabled) return "disabled";
|
|
29
|
+
if (isHovered) return "hovered";
|
|
30
|
+
return "default";
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const cursorValue = (state: IconButtonState): CursorValue => {
|
|
34
|
+
if (state === "disabled") return "not-allowed" as CursorValue;
|
|
35
|
+
return "pointer";
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export function IconButton(props: IconButtonProps) {
|
|
39
|
+
const {
|
|
40
|
+
render: IconComponent,
|
|
41
|
+
variant = "default",
|
|
42
|
+
isDisabled,
|
|
43
|
+
size,
|
|
44
|
+
color,
|
|
45
|
+
strokeWidth,
|
|
46
|
+
style,
|
|
47
|
+
...rest
|
|
48
|
+
} = props;
|
|
49
|
+
|
|
50
|
+
const variantStyles = IconButtonVariants[variant]();
|
|
51
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
52
|
+
const state = calculateState(props, isHovered);
|
|
53
|
+
|
|
54
|
+
const handlePress: PressableProps["onPress"] = (event) => {
|
|
55
|
+
if (isDisabled) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
rest.onPress?.(event);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const iconProps: SvgProps = {
|
|
63
|
+
size: size ?? variantStyles.icon?.default?.size,
|
|
64
|
+
color: color ?? variantStyles.icon?.[state]?.color ?? variantStyles.icon?.default?.color,
|
|
65
|
+
strokeWidth,
|
|
66
|
+
absoluteStrokeWidth: true,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Pressable
|
|
71
|
+
{...rest}
|
|
72
|
+
onPress={handlePress}
|
|
73
|
+
onHoverIn={(e) => {
|
|
74
|
+
setIsHovered(true);
|
|
75
|
+
rest.onHoverIn?.(e);
|
|
76
|
+
}}
|
|
77
|
+
onHoverOut={(e) => {
|
|
78
|
+
setIsHovered(false);
|
|
79
|
+
rest.onHoverOut?.(e);
|
|
80
|
+
}}
|
|
81
|
+
disabled={isDisabled}
|
|
82
|
+
style={[
|
|
83
|
+
variantStyles.root?.default,
|
|
84
|
+
variantStyles.root?.[state],
|
|
85
|
+
{ cursor: cursorValue(state) },
|
|
86
|
+
style,
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<IconComponent {...iconProps} />
|
|
90
|
+
</Pressable>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import type { SvgProps } from "../../types/props.types";
|
|
3
|
+
|
|
4
|
+
export type IconButtonState = "default" | "disabled" | "hovered";
|
|
5
|
+
|
|
6
|
+
export interface IconButtonStyles {
|
|
7
|
+
root?: Partial<Record<IconButtonState, StyleProp<ViewStyle>>>;
|
|
8
|
+
icon?: Partial<Record<IconButtonState, SvgProps>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantDefault = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
backgroundColor: colors.primary,
|
|
15
|
+
borderWidth: 1,
|
|
16
|
+
borderColor: colors.border,
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
},
|
|
21
|
+
hovered: {
|
|
22
|
+
backgroundColor: hslaSetRelativeLightness(colors.primary, -10),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
default: {
|
|
27
|
+
color: colors.primaryForeground,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantGhost = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
backgroundColor: "transparent",
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
opacity: 0.5,
|
|
18
|
+
},
|
|
19
|
+
hovered: {
|
|
20
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
icon: {
|
|
24
|
+
default: {
|
|
25
|
+
color: colors.foreground,
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
color: colors.mutedForeground,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useIconButtonVariantDefault } from "./default";
|
|
2
|
+
import { useIconButtonVariantGhost } from "./ghost";
|
|
3
|
+
import { useIconButtonVariantSecondary } from "./secondary";
|
|
4
|
+
|
|
5
|
+
export const IconButtonVariants = {
|
|
6
|
+
default: useIconButtonVariantDefault,
|
|
7
|
+
secondary: useIconButtonVariantSecondary,
|
|
8
|
+
ghost: useIconButtonVariantGhost,
|
|
9
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hslaSetRelativeLightness } from "../../../utils/hsla-utils";
|
|
2
|
+
import { useThemedStyles } from "../../../utils/use-themed-styles";
|
|
3
|
+
import type { IconButtonStyles } from "../types";
|
|
4
|
+
|
|
5
|
+
export const useIconButtonVariantSecondary = (): IconButtonStyles => {
|
|
6
|
+
return useThemedStyles(
|
|
7
|
+
({ colors, radius }): IconButtonStyles => ({
|
|
8
|
+
root: {
|
|
9
|
+
default: {
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
padding: 8,
|
|
13
|
+
borderRadius: radius,
|
|
14
|
+
borderWidth: 1,
|
|
15
|
+
borderColor: colors.border,
|
|
16
|
+
backgroundColor: colors.secondary,
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
opacity: 0.5,
|
|
20
|
+
},
|
|
21
|
+
hovered: {
|
|
22
|
+
backgroundColor: hslaSetRelativeLightness(colors.secondary, -1),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
default: {
|
|
27
|
+
color: colors.secondaryForeground,
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
color: colors.mutedForeground,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./checkbox";
|
|
|
9
9
|
export * from "./empty";
|
|
10
10
|
export * from "./field";
|
|
11
11
|
export * from "./icon";
|
|
12
|
+
export * from "./icon-button";
|
|
12
13
|
export * from "./input";
|
|
13
14
|
export * from "./link";
|
|
14
15
|
export * from "./list";
|
|
@@ -19,6 +20,7 @@ export * from "./portal";
|
|
|
19
20
|
export * from "./progress";
|
|
20
21
|
export * from "./scroll-bar";
|
|
21
22
|
export * from "./select";
|
|
23
|
+
export * from "./separator";
|
|
22
24
|
export * from "./tabs";
|
|
23
25
|
export * from "./textarea";
|
|
24
26
|
export * from "./toast";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { Pressable,
|
|
2
|
+
import { Pressable, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { useMenu } from "../context";
|
|
4
4
|
import type { MenuCheckboxItemState } from "../types";
|
|
5
5
|
import { useOrganizedChildren } from "../use-organized-children";
|
|
6
|
+
import { MenuSelectionIndicator } from "./menu-selection-indicator";
|
|
6
7
|
|
|
7
8
|
export interface MenuCheckboxItemProps {
|
|
8
9
|
children: React.ReactNode;
|
|
@@ -66,9 +67,7 @@ export function MenuCheckboxItem(props: MenuCheckboxItemProps) {
|
|
|
66
67
|
style={composedStyle}
|
|
67
68
|
>
|
|
68
69
|
{organizedChildren}
|
|
69
|
-
<
|
|
70
|
-
{props.checked ? "✓" : " "}
|
|
71
|
-
</Text>
|
|
70
|
+
<MenuSelectionIndicator isSelected={props.checked} />
|
|
72
71
|
</Pressable>
|
|
73
72
|
);
|
|
74
73
|
}
|
|
@@ -20,7 +20,7 @@ export function MenuContent(props: MenuContentProps) {
|
|
|
20
20
|
contentLayout: menu.contentLayout,
|
|
21
21
|
alignOffset: 0,
|
|
22
22
|
preferredSide: "bottom",
|
|
23
|
-
sideOffset:
|
|
23
|
+
sideOffset: 2,
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const composedStyle = [positionStyle, menu.styles?.content, props.style];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { Pressable,
|
|
2
|
+
import { Pressable, type StyleProp, type ViewStyle } from "react-native";
|
|
3
3
|
import { useMenu, useMenuRadioGroup } from "../context";
|
|
4
4
|
import type { MenuRadioItemState } from "../types";
|
|
5
5
|
import { useOrganizedChildren } from "../use-organized-children";
|
|
6
|
+
import { MenuSelectionIndicator } from "./menu-selection-indicator";
|
|
6
7
|
|
|
7
8
|
export interface MenuRadioItemProps {
|
|
8
9
|
children: React.ReactNode;
|
|
@@ -37,11 +38,6 @@ export function MenuRadioItem(props: MenuRadioItemProps) {
|
|
|
37
38
|
props.style,
|
|
38
39
|
];
|
|
39
40
|
|
|
40
|
-
const indicatorStyle = [
|
|
41
|
-
menu.styles?.radioIndicator?.default,
|
|
42
|
-
isSelected ? menu.styles?.radioIndicator?.selected : undefined,
|
|
43
|
-
];
|
|
44
|
-
|
|
45
41
|
const handlePress = () => {
|
|
46
42
|
if (props.disabled) return;
|
|
47
43
|
radioGroup.onValueChange(props.value);
|
|
@@ -74,7 +70,7 @@ export function MenuRadioItem(props: MenuRadioItemProps) {
|
|
|
74
70
|
style={composedStyle}
|
|
75
71
|
>
|
|
76
72
|
{organizedChildren}
|
|
77
|
-
<
|
|
73
|
+
<MenuSelectionIndicator isSelected={isSelected} />
|
|
78
74
|
</Pressable>
|
|
79
75
|
);
|
|
80
76
|
}
|