@ankhorage/zora 27.11.2 → 28.0.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.
- package/CHANGELOG.md +12 -0
- package/README.md +4 -3
- package/dist/features/color/ColorHexField.d.ts +1 -1
- package/dist/features/color/ColorHexField.d.ts.map +1 -1
- package/dist/features/color/ColorHexField.js +2 -3
- package/dist/features/color/ColorHexField.js.map +1 -1
- package/dist/features/color/ColorPicker.d.ts +1 -1
- package/dist/features/color/ColorPicker.d.ts.map +1 -1
- package/dist/features/color/ColorPicker.js +106 -52
- package/dist/features/color/ColorPicker.js.map +1 -1
- package/dist/features/color/ColorWheel.d.ts +1 -1
- package/dist/features/color/ColorWheel.d.ts.map +1 -1
- package/dist/features/color/ColorWheel.js +50 -117
- package/dist/features/color/ColorWheel.js.map +1 -1
- package/dist/features/color/ColorWheelPointerProxy.web.d.ts +1 -1
- package/dist/features/color/ColorWheelPointerProxy.web.d.ts.map +1 -1
- package/dist/features/color/ColorWheelPointerProxy.web.js +7 -4
- package/dist/features/color/ColorWheelPointerProxy.web.js.map +1 -1
- package/dist/features/color/public.d.ts +1 -1
- package/dist/features/color/public.d.ts.map +1 -1
- package/dist/features/color/public.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/color.d.ts +26 -26
- package/dist/types/color.d.ts.map +1 -1
- package/dist/types/color.js.map +1 -1
- package/package.json +3 -3
- package/src/features/color/ColorHexField.tsx +1 -3
- package/src/features/color/ColorPicker.layout.test.tsx +11 -16
- package/src/features/color/ColorPicker.tsx +217 -93
- package/src/features/color/ColorWheel.tsx +122 -248
- package/src/features/color/ColorWheelPointerProxy.web.tsx +11 -5
- package/src/features/color/public.ts +0 -2
- package/src/index.ts +0 -2
- package/src/types/color.ts +26 -22
- package/web-dist/chunks/Accordion-00h253nv.js +252 -0
- package/web-dist/chunks/{Accordion-qhn8z92r.js → Accordion-0gae3kzr.js} +3 -3
- package/web-dist/chunks/{Accordion-3jkeydhb.js → Accordion-0t53jhx1.js} +4 -4
- package/web-dist/chunks/{Accordion-vk2v1zwv.js → Accordion-1b2t4k36.js} +2 -2
- package/web-dist/chunks/{Accordion-aws0caav.js → Accordion-1dv8wytq.js} +3 -3
- package/web-dist/chunks/{Accordion-ysmzrvhn.js → Accordion-238zba4h.js} +3 -3
- package/web-dist/chunks/{Accordion-z8ryq8cb.js → Accordion-36674tfw.js} +7 -7
- package/web-dist/chunks/{Accordion-bd6q61s1.js → Accordion-36j1fw8r.js} +5 -5
- package/web-dist/chunks/{Accordion-jd26f516.js → Accordion-3ar6p84m.js} +3 -3
- package/web-dist/chunks/{Accordion-gezcm372.js → Accordion-3t2936t6.js} +4 -4
- package/web-dist/chunks/{Accordion-rzf52xq8.js → Accordion-43gp801f.js} +2 -2
- package/web-dist/chunks/{Accordion-c0a7mhq3.js → Accordion-52s4t1aq.js} +2 -2
- package/web-dist/chunks/{Accordion-vewhx028.js → Accordion-5adv6dv1.js} +4 -4
- package/web-dist/chunks/{Accordion-49w9bc2f.js → Accordion-5wx67nhg.js} +2 -2
- package/web-dist/chunks/{Accordion-p29kmwh9.js → Accordion-6225tr9r.js} +1 -1
- package/web-dist/chunks/{Accordion-x7ynjdv7.js → Accordion-6r1e7k5r.js} +1 -1
- package/web-dist/chunks/{Accordion-1mxnyexh.js → Accordion-6wcbzxzb.js} +13 -13
- package/web-dist/chunks/{Accordion-an5prgty.js → Accordion-7d0e5vhe.js} +1 -1
- package/web-dist/chunks/{Accordion-phtyg3k4.js → Accordion-7ppf31tg.js} +5 -5
- package/web-dist/chunks/{Accordion-5vs1k81g.js → Accordion-81rx3bh0.js} +8 -8
- package/web-dist/chunks/{Accordion-1etqb3cj.js → Accordion-8wm25z0h.js} +2 -2
- package/web-dist/chunks/{Accordion-f60g73bp.js → Accordion-94vndckf.js} +6 -6
- package/web-dist/chunks/{Accordion-ne91vwkd.js → Accordion-9fhsfynt.js} +2 -2
- package/web-dist/chunks/{Accordion-9c63jn3m.js → Accordion-ah1d9b6z.js} +4 -4
- package/web-dist/chunks/{Accordion-0kr0h68p.js → Accordion-b41rev86.js} +8 -8
- package/web-dist/chunks/{Accordion-q1tdazgq.js → Accordion-c8mmgjtj.js} +5 -5
- package/web-dist/chunks/{Accordion-pcj256bc.js → Accordion-d2kg4729.js} +5 -5
- package/web-dist/chunks/{Accordion-g451f3g9.js → Accordion-d4dp5ryp.js} +4 -4
- package/web-dist/chunks/{Accordion-dfq04q82.js → Accordion-dfv6p6gt.js} +4 -4
- package/web-dist/chunks/{Accordion-e3r3573t.js → Accordion-dpkp0y4p.js} +3 -3
- package/web-dist/chunks/{Accordion-pmfdf08d.js → Accordion-dxh9yn4f.js} +1 -1
- package/web-dist/chunks/{Accordion-zx8gmww4.js → Accordion-ec1tt3be.js} +9 -9
- package/web-dist/chunks/{Accordion-vnrqvfca.js → Accordion-epwpdegg.js} +1 -1
- package/web-dist/chunks/{Accordion-8g9c7890.js → Accordion-hbkzy0bg.js} +4 -4
- package/web-dist/chunks/{Accordion-c3nna2bz.js → Accordion-j6hgazmz.js} +1 -1
- package/web-dist/chunks/{Accordion-6nrpdbmb.js → Accordion-jara9sqj.js} +7 -7
- package/web-dist/chunks/{Accordion-3ecnh8d0.js → Accordion-knb3e18b.js} +4 -4
- package/web-dist/chunks/{Accordion-6m3k4avp.js → Accordion-m5baah44.js} +2 -2
- package/web-dist/chunks/{Accordion-3zw817fr.js → Accordion-nkppqfz4.js} +6 -6
- package/web-dist/chunks/{Accordion-3wkd5x2q.js → Accordion-phcp8d5v.js} +3 -3
- package/web-dist/chunks/{Accordion-x0p3wxfp.js → Accordion-pm2f2j32.js} +2 -2
- package/web-dist/chunks/{Accordion-j0zhpq4s.js → Accordion-q697hacs.js} +7 -7
- package/web-dist/chunks/{Accordion-eak89n4n.js → Accordion-re4r47xn.js} +6 -6
- package/web-dist/chunks/{Accordion-r1wkgt7c.js → Accordion-rev9ssd4.js} +516 -544
- package/web-dist/chunks/{Accordion-h2nd5y0z.js → Accordion-sn241nek.js} +5 -5
- package/web-dist/chunks/{Accordion-jbwey4za.js → Accordion-tppk4vwt.js} +9 -9
- package/web-dist/chunks/{Accordion-6yv4beha.js → Accordion-wbmzvfaw.js} +1 -1
- package/web-dist/chunks/{Accordion-4g54je0w.js → Accordion-wcw153f0.js} +2 -2
- package/web-dist/chunks/{Accordion-705yrq6w.js → Accordion-wpj8pd40.js} +1 -1
- package/web-dist/chunks/{Accordion-z4qakakw.js → Accordion-ytxgphds.js} +2 -2
- package/web-dist/chunks/{Accordion-h0e95qxp.js → Accordion-z1cq2mnx.js} +9 -9
- package/web-dist/chunks/{Accordion-xb174981.js → Accordion-z9yw0xy9.js} +8 -8
- package/web-dist/chunks/{Accordion-e5jr9ahb.js → Accordion-zte416jw.js} +1 -1
- package/web-dist/chunks/{Accordion-xwstve3k.js → Accordion-zzymcpty.js} +2 -2
- package/web-dist/components/accordion/Accordion.js +10 -10
- package/web-dist/components/accordion-item/AccordionItem.js +10 -10
- package/web-dist/components/activity-indicator/ActivityIndicator.js +3 -3
- package/web-dist/components/app-bar/AppBar.js +15 -15
- package/web-dist/components/app-header/AppHeader.js +15 -15
- package/web-dist/components/app-shell/AppShell.js +4 -4
- package/web-dist/components/auth-screen/AuthScreen.js +20 -20
- package/web-dist/components/avatar/Avatar.js +10 -10
- package/web-dist/components/avatar-group/AvatarGroup.js +10 -10
- package/web-dist/components/badge/Badge.js +5 -5
- package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +18 -18
- package/web-dist/components/bottom-sheet/BottomSheet.js +6 -6
- package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +6 -6
- package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +6 -6
- package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +6 -6
- package/web-dist/components/bottom-sheet-view/BottomSheetView.js +6 -6
- package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +6 -6
- package/web-dist/components/breadcrumbs/Breadcrumbs.js +12 -12
- package/web-dist/components/button/Button.js +10 -10
- package/web-dist/components/button-group/ButtonGroup.js +10 -10
- package/web-dist/components/calendar/Calendar.js +12 -12
- package/web-dist/components/camera-permission-view/CameraPermissionView.js +18 -18
- package/web-dist/components/card/Card.js +17 -17
- package/web-dist/components/card-back/CardBack.js +4 -4
- package/web-dist/components/card-hand/CardHand.js +4 -4
- package/web-dist/components/carousel/Carousel.js +2 -2
- package/web-dist/components/chat-list-item/ChatListItem.js +14 -14
- package/web-dist/components/checkbox/Checkbox.js +10 -10
- package/web-dist/components/checkbox-group/CheckboxGroup.js +10 -10
- package/web-dist/components/chess-board/ChessBoard.js +4 -4
- package/web-dist/components/chip/Chip.js +11 -11
- package/web-dist/components/chip-group/ChipGroup.js +11 -11
- package/web-dist/components/collection-editor/CollectionEditor.js +17 -17
- package/web-dist/components/color-hue-scale/ColorHueScale.js +27 -16
- package/web-dist/components/color-picker/ColorPicker.d.ts +2 -2
- package/web-dist/components/color-picker/ColorPicker.js +27 -16
- package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +26 -45
- package/web-dist/components/color-picker/index.d.ts +1 -1
- package/web-dist/components/color-tone/ColorTone.js +27 -16
- package/web-dist/components/color-wheel/ColorWheel.d.ts +1 -1
- package/web-dist/components/color-wheel/ColorWheel.js +27 -16
- package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +2 -0
- package/web-dist/components/content-rail/ContentRail.js +11 -11
- package/web-dist/components/data-table/DataTable.js +23 -23
- package/web-dist/components/date-picker/DatePicker.js +16 -16
- package/web-dist/components/dialog/Dialog.js +9 -9
- package/web-dist/components/divider/Divider.js +4 -4
- package/web-dist/components/empty-state/EmptyState.js +18 -18
- package/web-dist/components/explorer/Explorer.js +11 -11
- package/web-dist/components/field/Field.js +10 -10
- package/web-dist/components/file-explorer/FileExplorer.js +11 -11
- package/web-dist/components/flat-list/FlatList.js +11 -11
- package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +20 -20
- package/web-dist/components/form/Form.js +14 -14
- package/web-dist/components/form-actions/FormActions.js +14 -14
- package/web-dist/components/form-error/FormError.js +14 -14
- package/web-dist/components/game/Game.js +5 -5
- package/web-dist/components/game-entity/GameEntity.js +5 -5
- package/web-dist/components/game-field/GameField.js +5 -5
- package/web-dist/components/game-input-zone/GameInputZone.js +5 -5
- package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +5 -5
- package/web-dist/components/game-overlay/GameOverlay.js +5 -5
- package/web-dist/components/gradient/Gradient.js +5 -5
- package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +5 -5
- package/web-dist/components/grid/Grid.js +4 -4
- package/web-dist/components/grid-line-overlay/GridLineOverlay.js +4 -4
- package/web-dist/components/grid-ruler/GridRuler.js +4 -4
- package/web-dist/components/heading/Heading.js +5 -5
- package/web-dist/components/hero/Hero.js +17 -17
- package/web-dist/components/icon/Icon.js +4 -4
- package/web-dist/components/icon-button/IconButton.js +10 -10
- package/web-dist/components/image/Image.js +8 -8
- package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +3 -3
- package/web-dist/components/list/List.js +11 -11
- package/web-dist/components/list-item/ListItem.js +11 -11
- package/web-dist/components/list-section/ListSection.js +11 -11
- package/web-dist/components/master-detail/MasterDetail.js +4 -4
- package/web-dist/components/matrix-grid/MatrixGrid.js +4 -4
- package/web-dist/components/media-card/MediaCard.js +17 -17
- package/web-dist/components/media-explorer/MediaExplorer.js +11 -11
- package/web-dist/components/message-bubble/MessageBubble.js +14 -14
- package/web-dist/components/metric-card/MetricCard.js +17 -17
- package/web-dist/components/missing-element/MissingElement.js +9 -9
- package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +20 -20
- package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +20 -20
- package/web-dist/components/opening-book/OpeningBook.js +4 -4
- package/web-dist/components/otp-form/OtpForm.js +20 -20
- package/web-dist/components/pagination/Pagination.js +11 -11
- package/web-dist/components/palette-item/PaletteItem.js +17 -17
- package/web-dist/components/playing-card/PlayingCard.js +4 -4
- package/web-dist/components/poker-training-table/PokerTrainingTable.js +4 -4
- package/web-dist/components/popover-menu/PopoverMenu.js +10 -10
- package/web-dist/components/post-card/PostCard.js +17 -17
- package/web-dist/components/product-card/ProductCard.js +17 -17
- package/web-dist/components/progress/Progress.js +8 -8
- package/web-dist/components/progress-ring/ProgressRing.js +8 -8
- package/web-dist/components/radio/Radio.js +12 -12
- package/web-dist/components/radio-group/RadioGroup.js +12 -12
- package/web-dist/components/rating/Rating.js +7 -7
- package/web-dist/components/reader/Reader.js +18 -18
- package/web-dist/components/scan-overlay/ScanOverlay.js +18 -18
- package/web-dist/components/screen/Screen.js +4 -4
- package/web-dist/components/screen-section/ScreenSection.js +8 -8
- package/web-dist/components/scroll-view/ScrollView.js +4 -4
- package/web-dist/components/search-input/SearchInput.js +12 -12
- package/web-dist/components/section-header/SectionHeader.js +8 -8
- package/web-dist/components/section-list/SectionList.js +11 -11
- package/web-dist/components/select/Select.js +21 -257
- package/web-dist/components/selectable-item/SelectableItem.js +3 -3
- package/web-dist/components/selection-provider/SelectionProvider.js +3 -3
- package/web-dist/components/sign-in-form/SignInForm.js +20 -20
- package/web-dist/components/sign-up-form/SignUpForm.js +20 -20
- package/web-dist/components/skeleton/Skeleton.js +20 -20
- package/web-dist/components/skeleton-card/SkeletonCard.js +20 -20
- package/web-dist/components/skeleton-list/SkeletonList.js +20 -20
- package/web-dist/components/skeleton-text/SkeletonText.js +20 -20
- package/web-dist/components/surface/Surface.js +5 -5
- package/web-dist/components/switch/Switch.js +5 -5
- package/web-dist/components/tab/Tab.js +5 -5
- package/web-dist/components/tab-list/TabList.js +5 -5
- package/web-dist/components/tab-panel/TabPanel.js +5 -5
- package/web-dist/components/tabletop-table/TabletopTable.js +4 -4
- package/web-dist/components/tabs/Tabs.js +5 -5
- package/web-dist/components/text/Text.js +5 -5
- package/web-dist/components/text-input/TextInput.js +12 -12
- package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +10 -10
- package/web-dist/components/time-picker/TimePicker.js +15 -15
- package/web-dist/components/timeline/Timeline.js +10 -10
- package/web-dist/components/toast/Toast.js +7 -7
- package/web-dist/components/toast-provider/ToastProvider.js +7 -7
- package/web-dist/components/toolbar/Toolbar.js +17 -17
- package/web-dist/components/tree-item/TreeItem.js +15 -15
- package/web-dist/components/uploader/Uploader.js +20 -20
- package/web-dist/components/view/View.js +4 -4
- package/web-dist/manifest.json +1495 -1446
- package/web-dist/runtime/ZoraProvider.js +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorWheel.js","sourceRoot":"","sources":["../../../src/features/color/ColorWheel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAiB,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,OAAO,EACP,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,GAAG,GACJ,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC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ACzD,MAAc;IAEd,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAC3B,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/B,KAAK,EAAE;YACL,GAAG,KAAK;YACR,CAAC,IAAI,CACH,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CACzD,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EACZ;SACH;QACD,QAAQ,EAAE,KAAK;KAChB,CAAC,EACF,EAAE,KAAK,EAAE,EAAuB,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAC5E,CAAC,KAAK,CAAC;AACV,CAAC;AAED,kFAAkF;AAClF,SAAS,qBAAqB,CAAC,KAAe;IAC5C,MAAM,EAAE,SAAS,EAAE,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { generateHarmonyRoleColors, type HexColor } from '@ankhorage/color-theory';\nimport { Button } from '@ankhorage/surface';\nimport React from 'react';\nimport {\n Circle,\n Defs,\n Line,\n LinearGradient,\n Path,\n Polygon,\n RadialGradient,\n Rect,\n Stop,\n Svg,\n} from 'react-native-svg';\n\nimport type { ColorWheelProps } from '../../types/color';\nimport { View } from '../layout/public';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { Text } from '../typography/public';\nimport { ColorHexField } from './ColorHexField';\nimport { ColorHorizontalPointerProxy } from './ColorHorizontalPointerProxy';\nimport { ColorWheelKeyboardProxy } from './ColorWheelKeyboardProxy';\nimport { ColorWheelPointerProxy } from './ColorWheelPointerProxy';\nimport { resolveColorHue } from './utils/resolveColorHue';\nimport { resolveOklchColor } from './utils/resolveOklchColor';\nimport { resolveWheelColor } from './utils/resolveWheelColor';\nimport { resolveWheelColorComponents } from './utils/resolveWheelColorComponents';\n\nconst WHEEL_SIZE = 280;\nconst WHEEL_CENTER = WHEEL_SIZE / 2;\nconst WHEEL_RADIUS = 128;\nconst WHEEL_SEGMENT_COUNT = 72;\nconst WHEEL_MAX_CHROMA = 0.2;\n\n/*** Selects an OKLCH hue and optionally visualizes the existing color-theory harmony. */\nexport const ColorWheel = withZoraThemeScope(ColorWheelInner);\n\n/*** Renders a directly manipulable hue wheel and harmony controls without returning derived colors. */\nfunction ColorWheelInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n interactionPolicy,\n value,\n harmony = null,\n harmonies,\n onChange,\n testID,\n}: ColorWheelProps) {\n const { theme } = useZoraTheme();\n const hue = resolveColorHue(value);\n const { chroma, lightness } = resolveWheelColorComponents(value);\n const harmonyColors = harmony ? generateHarmonyRoleColors(value, harmony).colors : [];\n const selectedPoint = resolveWheelPoint(hue, Math.min(1, chroma / WHEEL_MAX_CHROMA));\n const harmonyPoints = harmonyColors.map((color) => resolveWheelPoint(color.hueDegrees));\n const harmonyLines = resolveHarmonyLines(\n harmonyPoints,\n selectedPoint,\n theme.semantics.content.default,\n );\n const wheelGradientId = `color-wheel-${React.useId().replaceAll(':', '')}`;\n const changeColorAt = (x: number, y: number) => {\n if (interactionPolicy === 'passive') return;\n onChange({\n color: resolveWheelColor(value, x, y, WHEEL_CENTER, WHEEL_RADIUS, WHEEL_MAX_CHROMA),\n harmony,\n });\n };\n const changeLightness = (nextLightness: number) =>\n onChange({\n color: resolveOklchColor({ chroma, lightness: Math.max(0, Math.min(1, nextLightness)) }, hue),\n harmony,\n });\n\n return (\n <View align=\"center\" gap=\"s\" testID={testID}>\n <ColorWheelKeyboardProxy\n chroma={chroma}\n disabled={interactionPolicy === 'passive'}\n hue={hue}\n onChange={(nextHue, nextChroma) =>\n onChange({\n color: resolveOklchColor(\n { lightness: resolveWheelLightness(value), chroma: nextChroma },\n nextHue,\n ),\n harmony,\n })\n }\n >\n <ColorWheelPointerProxy\n disabled={interactionPolicy === 'passive'}\n height={WHEEL_SIZE}\n onChange={changeColorAt}\n width={WHEEL_SIZE}\n >\n <Svg\n accessibilityLabel=\"Color wheel\"\n height={WHEEL_SIZE}\n onResponderGrant={(event) => {\n const { locationX, locationY } = event.nativeEvent;\n changeColorAt(locationX, locationY);\n }}\n onResponderMove={(event) => {\n const { locationX, locationY } = event.nativeEvent;\n changeColorAt(locationX, locationY);\n }}\n onResponderRelease={(event) => {\n const { locationX, locationY } = event.nativeEvent;\n changeColorAt(locationX, locationY);\n }}\n onStartShouldSetResponder={() => interactionPolicy !== 'passive'}\n width={WHEEL_SIZE}\n >\n <Defs>\n {resolveWheelSegments().map((segment) => (\n <RadialGradient\n cx={WHEEL_CENTER}\n cy={WHEEL_CENTER}\n id={`${wheelGradientId}-${segment.hue}`}\n key={segment.hue}\n r={WHEEL_RADIUS}\n >\n <Stop\n offset=\"0\"\n stopColor={resolveOklchColor({ lightness: 0.65, chroma: 0 }, segment.hue)}\n />\n <Stop offset=\"1\" stopColor={segment.color} />\n </RadialGradient>\n ))}\n </Defs>\n {resolveWheelSegments().map((segment) => (\n <Path\n d={segment.path}\n fill={`url(#${wheelGradientId}-${segment.hue})`}\n key={segment.hue}\n />\n ))}\n {harmony === 'triadic' && harmonyPoints.length === 3 ? (\n <Polygon\n fill=\"none\"\n points={harmonyPoints.map((point) => `${point.x},${point.y}`).join(' ')}\n stroke={theme.semantics.content.default}\n strokeWidth={2}\n />\n ) : (\n harmonyLines\n )}\n {harmonyPoints.map((point) => (\n <Circle\n cx={point.x}\n cy={point.y}\n fill={theme.semantics.content.default}\n key={`${point.x}-${point.y}`}\n r={5}\n />\n ))}\n <Circle\n cx={selectedPoint.x}\n cy={selectedPoint.y}\n fill=\"none\"\n r={9}\n stroke={theme.semantics.content.default}\n strokeWidth={3}\n />\n </Svg>\n </ColorWheelPointerProxy>\n </ColorWheelKeyboardProxy>\n <ColorLightnessSlider\n chroma={chroma}\n disabled={interactionPolicy === 'passive'}\n hue={hue}\n lightness={lightness}\n onChange={changeLightness}\n selectionBorderColor={theme.semantics.content.default}\n />\n <ColorHexField\n disabled={interactionPolicy === 'passive'}\n key={value}\n onChange={(color) => onChange({ color, harmony })}\n value={value}\n />\n {harmonies ? (\n <View direction=\"row\" gap=\"xs\" wrap=\"wrap\">\n <Button\n disabled={interactionPolicy === 'passive'}\n onPress={() => onChange({ color: value, harmony: null })}\n variant={harmony === null ? 'solid' : 'outline'}\n >\n None\n </Button>\n {harmonies.map((candidate) => (\n <Button\n key={candidate}\n disabled={interactionPolicy === 'passive'}\n onPress={() => onChange({ color: value, harmony: candidate })}\n variant={harmony === candidate ? 'solid' : 'outline'}\n >\n {candidate}\n </Button>\n ))}\n </View>\n ) : null}\n </View>\n );\n}\n\n/*** Renders a continuous OKLCH lightness track without adding a second color persistence model. */\nfunction ColorLightnessSlider({\n chroma,\n disabled,\n hue,\n lightness,\n onChange,\n selectionBorderColor,\n}: {\n readonly chroma: number;\n readonly disabled: boolean;\n readonly hue: number;\n readonly lightness: number;\n readonly onChange: (lightness: number) => void;\n readonly selectionBorderColor: string;\n}) {\n const changeAt = (locationX: number) => {\n if (!disabled) onChange(Math.max(0, Math.min(1, locationX / WHEEL_SIZE)));\n };\n return (\n <View gap=\"xxs\" width={WHEEL_SIZE}>\n <View direction=\"row\" justify=\"space-between\">\n <Text variant=\"label\">Lightness</Text>\n <Text variant=\"label\">{`${Math.round(lightness * 100)}%`}</Text>\n </View>\n <ColorHorizontalPointerProxy disabled={disabled} onChange={changeAt} width={WHEEL_SIZE}>\n <Svg accessibilityLabel=\"Color lightness\" height={36} width={WHEEL_SIZE}>\n <Defs>\n <LinearGradient id=\"color-lightness\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"0\">\n <Stop offset=\"0\" stopColor={resolveOklchColor({ chroma, lightness: 0 }, hue)} />\n <Stop offset=\"1\" stopColor={resolveOklchColor({ chroma, lightness: 1 }, hue)} />\n </LinearGradient>\n </Defs>\n <Rect fill=\"url(#color-lightness)\" height={10} rx={5} y={13} width={WHEEL_SIZE} />\n <Circle\n cx={lightness * WHEEL_SIZE}\n cy={18}\n fill=\"white\"\n r={10}\n stroke={selectionBorderColor}\n strokeWidth={2}\n />\n <Rect\n fill=\"transparent\"\n height={36}\n onResponderGrant={(event) => changeAt(event.nativeEvent.locationX)}\n onResponderMove={(event) => changeAt(event.nativeEvent.locationX)}\n onResponderRelease={(event) => changeAt(event.nativeEvent.locationX)}\n onStartShouldSetResponder={() => !disabled}\n width={WHEEL_SIZE}\n />\n </Svg>\n </ColorHorizontalPointerProxy>\n </View>\n );\n}\n\n/*** Build the wheel's OKLCH segments from the existing conversion tool. */\nfunction resolveWheelSegments(): readonly {\n readonly color: HexColor;\n readonly hue: number;\n readonly path: string;\n}[] {\n return Array.from({ length: WHEEL_SEGMENT_COUNT }, (_, index) => {\n const hue = (index * 360) / WHEEL_SEGMENT_COUNT;\n return {\n color: resolveOklchColor({ lightness: 0.65, chroma: WHEEL_MAX_CHROMA }, hue),\n hue,\n path: resolveSegmentPath(hue, hue + 360 / WHEEL_SEGMENT_COUNT),\n };\n });\n}\n\n/*** Describe one wedge in the visual hue wheel. */\nfunction resolveSegmentPath(startHue: number, endHue: number): string {\n const start = resolveWheelPoint(startHue);\n const end = resolveWheelPoint(endHue);\n return `M ${WHEEL_CENTER} ${WHEEL_CENTER} L ${start.x} ${start.y} A ${WHEEL_RADIUS} ${WHEEL_RADIUS} 0 0 1 ${end.x} ${end.y} Z`;\n}\n\n/*** Convert a hue degree to the corresponding visual wheel coordinate. */\nfunction resolveWheelPoint(\n hue: number,\n radiusRatio = 1,\n): { readonly x: number; readonly y: number } {\n const radians = ((hue - 90) * Math.PI) / 180;\n return {\n x: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.cos(radians),\n y: WHEEL_CENTER + WHEEL_RADIUS * radiusRatio * Math.sin(radians),\n };\n}\n\n/*** Connect consecutive harmony points without dynamic collection indexing. */\nfunction resolveHarmonyLines(\n points: readonly { readonly x: number; readonly y: number }[],\n selectedPoint: { readonly x: number; readonly y: number },\n stroke: string,\n) {\n return points.slice(1).reduce(\n ({ lines, previous }, point) => ({\n lines: [\n ...lines,\n <Line\n key={`${previous.x}-${previous.y}-${point.x}-${point.y}`}\n stroke={stroke}\n strokeWidth={2}\n x1={previous.x}\n x2={point.x}\n y1={previous.y}\n y2={point.y}\n />,\n ],\n previous: point,\n }),\n { lines: [] as React.ReactNode[], previous: points.at(0) ?? selectedPoint },\n ).lines;\n}\n\n/*** Read the selected color's lightness for wheel-only hue and chroma changes. */\nfunction resolveWheelLightness(color: HexColor): number {\n const { lightness } = resolveWheelColorComponents(color);\n return lightness;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ColorWheel.js","sourceRoot":"","sources":["../../../src/features/color/ColorWheel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAiB,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAGhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,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EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CACf,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EACZ;SACH;QACD,QAAQ,EAAE,KAAK;KAChB,CAAC,EACF,EAAE,KAAK,EAAE,EAAuB,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CACtE,CAAC,KAAK,CAAC;AACV,CAAC","sourcesContent":["import { generateHarmonyRoleColors, type HexColor } from '@ankhorage/color-theory';\nimport React from 'react';\nimport { Circle, Defs, Line, Path, Polygon, RadialGradient, Stop, Svg } from 'react-native-svg';\n\nimport type { ColorWheelProps } from '../../types/color';\nimport { withZoraThemeScope } from '../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../theme/composition/useZoraTheme';\nimport { ColorWheelKeyboardProxy } from './ColorWheelKeyboardProxy';\nimport { ColorWheelPointerProxy } from './ColorWheelPointerProxy';\nimport { resolveColorHue } from './utils/resolveColorHue';\nimport { resolveOklchColor } from './utils/resolveOklchColor';\nimport { resolveWheelColor } from './utils/resolveWheelColor';\nimport { resolveWheelColorComponents } from './utils/resolveWheelColorComponents';\n\nconst VIEWBOX = 1000;\nconst CENTER = VIEWBOX / 2;\nconst RADIUS = 480;\nconst SEGMENTS = 96;\nconst MAX_CHROMA = 0.2;\n\n/*** Renders a size-owned, filled OKLCH wheel with controlled primary and harmony points. */\nexport const ColorWheel = withZoraThemeScope(ColorWheelInner);\n\n/*** Maps pointer and keyboard input through one viewBox into the controlled selected colour. */\nfunction ColorWheelInner({\n themeId: _themeId,\n mode: _mode,\n inverted: _inverted,\n interactionPolicy,\n value,\n harmony = null,\n onChange,\n size = 340,\n testID,\n}: ColorWheelProps) {\n const { theme } = useZoraTheme();\n const hue = resolveColorHue(value);\n const { chroma, lightness } = resolveWheelColorComponents(value);\n const primaryPoint = pointFor(hue, Math.min(1, chroma / MAX_CHROMA));\n const harmonyPoints = harmony\n ? generateHarmonyRoleColors(value, harmony).colors.map((color) => pointFor(color.hueDegrees))\n : [];\n const gradientId = `color-wheel-${React.useId().replaceAll(':', '')}`;\n const changeAt = (x: number, y: number) => {\n if (interactionPolicy !== 'passive')\n onChange({ color: resolveWheelColor(value, x, y, CENTER, RADIUS, MAX_CHROMA), harmony });\n };\n return (\n <ColorWheelKeyboardProxy\n chroma={chroma}\n disabled={interactionPolicy === 'passive'}\n hue={hue}\n onChange={(nextHue, nextChroma) =>\n onChange({ color: resolveOklchColor({ chroma: nextChroma, lightness }, nextHue), harmony })\n }\n >\n <ColorWheelPointerProxy\n disabled={interactionPolicy === 'passive'}\n height={VIEWBOX}\n onChange={changeAt}\n width={VIEWBOX}\n >\n <Svg\n accessibilityLabel=\"Color wheel\"\n height={size}\n onResponderGrant={(event) =>\n changeAt(\n (event.nativeEvent.locationX / size) * VIEWBOX,\n (event.nativeEvent.locationY / size) * VIEWBOX,\n )\n }\n onResponderMove={(event) =>\n changeAt(\n (event.nativeEvent.locationX / size) * VIEWBOX,\n (event.nativeEvent.locationY / size) * VIEWBOX,\n )\n }\n onResponderRelease={(event) =>\n changeAt(\n (event.nativeEvent.locationX / size) * VIEWBOX,\n (event.nativeEvent.locationY / size) * VIEWBOX,\n )\n }\n onStartShouldSetResponder={() => interactionPolicy !== 'passive'}\n testID={testID}\n viewBox={`0 0 ${VIEWBOX} ${VIEWBOX}`}\n width={size}\n >\n <Defs>\n {segments().map((segment) => (\n <RadialGradient\n cx={CENTER}\n cy={CENTER}\n id={`${gradientId}-${segment.hue}`}\n key={segment.hue}\n r={RADIUS}\n >\n <Stop\n offset=\"0\"\n stopColor={resolveOklchColor({ chroma: 0, lightness: 0.72 }, segment.hue)}\n />\n <Stop offset=\"1\" stopColor={segment.color} />\n </RadialGradient>\n ))}\n </Defs>\n {segments().map((segment) => (\n <Path d={segment.path} fill={`url(#${gradientId}-${segment.hue})`} key={segment.hue} />\n ))}\n {harmonyPoints.length === 3 ? (\n <Polygon\n fill=\"none\"\n points={harmonyPoints.map((point) => `${point.x},${point.y}`).join(' ')}\n stroke={theme.semantics.content.default}\n strokeWidth={6}\n />\n ) : (\n linesFor(harmonyPoints, primaryPoint, theme.semantics.content.default)\n )}\n {harmonyPoints.map((point) => (\n <Circle\n cx={point.x}\n cy={point.y}\n fill={theme.semantics.content.default}\n key={`${point.x}-${point.y}`}\n r={26}\n />\n ))}\n <Circle\n cx={primaryPoint.x}\n cy={primaryPoint.y}\n fill=\"none\"\n r={36}\n stroke=\"white\"\n strokeWidth={12}\n />\n <Circle\n cx={primaryPoint.x}\n cy={primaryPoint.y}\n fill=\"none\"\n r={42}\n stroke={theme.semantics.content.default}\n strokeWidth={6}\n />\n </Svg>\n </ColorWheelPointerProxy>\n </ColorWheelKeyboardProxy>\n );\n}\n\n/*** Creates continuous-looking radial hue segments for the wheel viewBox. */\nfunction segments(): readonly {\n readonly color: HexColor;\n readonly hue: number;\n readonly path: string;\n}[] {\n return Array.from({ length: SEGMENTS }, (_, index) => {\n const hue = (index * 360) / SEGMENTS;\n return {\n color: resolveOklchColor({ chroma: MAX_CHROMA, lightness: 0.65 }, hue),\n hue,\n path: segmentPath(hue, hue + 360 / SEGMENTS),\n };\n });\n}\n\n/*** Describes one filled wheel segment in the stable coordinate system. */\nfunction segmentPath(start: number, end: number) {\n const startPoint = pointFor(start);\n const endPoint = pointFor(end);\n return `M ${CENTER} ${CENTER} L ${startPoint.x} ${startPoint.y} A ${RADIUS} ${RADIUS} 0 0 1 ${endPoint.x} ${endPoint.y} Z`;\n}\n\n/*** Projects an OKLCH hue and chroma ratio into the wheel coordinate system. */\nfunction pointFor(hue: number, ratio = 1) {\n const radians = ((hue - 90) * Math.PI) / 180;\n return {\n x: CENTER + RADIUS * ratio * Math.cos(radians),\n y: CENTER + RADIUS * ratio * Math.sin(radians),\n };\n}\n\n/*** Connects derived harmony points behind their corresponding knobs. */\nfunction linesFor(\n points: readonly { readonly x: number; readonly y: number }[],\n primary: { readonly x: number; readonly y: number },\n stroke: string,\n) {\n return points.slice(1).reduce(\n ({ lines, previous }, point) => ({\n lines: [\n ...lines,\n <Line\n key={`${previous.x}-${previous.y}-${point.x}-${point.y}`}\n stroke={stroke}\n strokeWidth={6}\n x1={previous.x}\n x2={point.x}\n y1={previous.y}\n y2={point.y}\n />,\n ],\n previous: point,\n }),\n { lines: [] as React.ReactNode[], previous: points.at(0) ?? primary },\n ).lines;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ColorWheelPointerProxyProps } from './ColorWheelPointerProxy';
|
|
3
|
-
/*** Maps
|
|
3
|
+
/*** Maps mouse, pen and touch coordinates into the wheel viewBox for click and drag selection. */
|
|
4
4
|
export declare function ColorWheelPointerProxy({ children, disabled, height, onChange, width, }: ColorWheelPointerProxyProps): React.JSX.Element;
|
|
5
5
|
//# sourceMappingURL=ColorWheelPointerProxy.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorWheelPointerProxy.web.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorWheelPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAE5E,
|
|
1
|
+
{"version":3,"file":"ColorWheelPointerProxy.web.d.ts","sourceRoot":"","sources":["../../../src/features/color/ColorWheelPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAE5E,kGAAkG;AAClG,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KAAK,GACN,EAAE,2BAA2B,qBAoC7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
/*** Maps
|
|
2
|
+
/*** Maps mouse, pen and touch coordinates into the wheel viewBox for click and drag selection. */
|
|
3
3
|
export function ColorWheelPointerProxy({ children, disabled, height, onChange, width, }) {
|
|
4
4
|
const dragging = React.useRef(false);
|
|
5
5
|
const changeAt = (event) => {
|
|
@@ -7,18 +7,21 @@ export function ColorWheelPointerProxy({ children, disabled, height, onChange, w
|
|
|
7
7
|
const rect = target.getBoundingClientRect();
|
|
8
8
|
onChange(((event.clientX - rect.left) / rect.width) * width, ((event.clientY - rect.top) / rect.height) * height);
|
|
9
9
|
};
|
|
10
|
-
return (<div
|
|
10
|
+
return (<div onPointerDown={(event) => {
|
|
11
11
|
if (disabled)
|
|
12
12
|
return;
|
|
13
13
|
dragging.current = true;
|
|
14
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
14
15
|
changeAt(event);
|
|
15
|
-
}}
|
|
16
|
+
}} onPointerMove={(event) => {
|
|
16
17
|
if (!disabled && dragging.current)
|
|
17
18
|
changeAt(event);
|
|
18
|
-
}}
|
|
19
|
+
}} onPointerUp={(event) => {
|
|
19
20
|
if (!disabled && dragging.current)
|
|
20
21
|
changeAt(event);
|
|
21
22
|
dragging.current = false;
|
|
23
|
+
}} onPointerCancel={() => {
|
|
24
|
+
dragging.current = false;
|
|
22
25
|
}} style={{ touchAction: 'none' }}>
|
|
23
26
|
{children}
|
|
24
27
|
</div>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorWheelPointerProxy.web.js","sourceRoot":"","sources":["../../../src/features/color/ColorWheelPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,
|
|
1
|
+
{"version":3,"file":"ColorWheelPointerProxy.web.js","sourceRoot":"","sources":["../../../src/features/color/ColorWheelPointerProxy.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,kGAAkG;AAClG,M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,GAAG,EAAE;YACpB,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;QAC3B,CAAC,CAAC,CACF,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAE/B;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ColorWheelPointerProxyProps } from './ColorWheelPointerProxy';\n\n/*** Maps mouse, pen and touch coordinates into the wheel viewBox for click and drag selection. */\nexport function ColorWheelPointerProxy({\n children,\n disabled,\n height,\n onChange,\n width,\n}: ColorWheelPointerProxyProps) {\n const dragging = React.useRef(false);\n const changeAt = (event: React.PointerEvent<HTMLDivElement>) => {\n const target = event.currentTarget as unknown as BrowserPointerTarget;\n const rect = target.getBoundingClientRect();\n onChange(\n ((event.clientX - rect.left) / rect.width) * width,\n ((event.clientY - rect.top) / rect.height) * height,\n );\n };\n\n return (\n <div\n onPointerDown={(event) => {\n if (disabled) return;\n dragging.current = true;\n (\n event.currentTarget as unknown as { setPointerCapture: (pointerId: number) => void }\n ).setPointerCapture(event.pointerId);\n changeAt(event);\n }}\n onPointerMove={(event) => {\n if (!disabled && dragging.current) changeAt(event);\n }}\n onPointerUp={(event) => {\n if (!disabled && dragging.current) changeAt(event);\n dragging.current = false;\n }}\n onPointerCancel={() => {\n dragging.current = false;\n }}\n style={{ touchAction: 'none' }}\n >\n {children}\n </div>\n );\n}\n\ninterface BrowserPointerTarget {\n readonly getBoundingClientRect: () => {\n readonly height: number;\n readonly left: number;\n readonly top: number;\n readonly width: number;\n };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ColorHueScaleProps, ColorPickerProps,
|
|
1
|
+
export type { ColorHueScaleProps, ColorPickerProps, ColorPickerTab, ColorToneDefinition, ColorToneProps, ColorToneSelection, ColorToneTarget, ColorWheelProps, ColorWheelSelection, } from '../../types/color';
|
|
2
2
|
export { ColorHueScale } from './ColorHueScale';
|
|
3
3
|
export { ColorPicker } from './ColorPicker';
|
|
4
4
|
export { ColorTone } from './ColorTone';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/color/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/color/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/color/public.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/color/public.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export type {\n ColorHueScaleProps,\n ColorPickerProps,\n ColorPickerTab,\n ColorToneDefinition,\n ColorToneProps,\n ColorToneSelection,\n ColorToneTarget,\n ColorWheelProps,\n ColorWheelSelection,\n} from '../../types/color';\nexport { ColorHueScale } from './ColorHueScale';\nexport { ColorPicker } from './ColorPicker';\nexport { ColorTone } from './ColorTone';\nexport { ColorWheel } from './ColorWheel';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type { AuthoringBindingControlState, AuthoringBindingEditorAdapterProps,
|
|
|
2
2
|
export { AuthoringBindingEditorAdapter, AuthoringPropertyInspectorAdapter, AuthoringSelectionAdapter, ThemeEditorAdapter, } from './authoring';
|
|
3
3
|
export type { CarouselProps, CarouselSlide, CarouselTransition } from './features/carousel/public';
|
|
4
4
|
export { Carousel } from './features/carousel/public';
|
|
5
|
-
export type { ColorHueScaleProps, ColorPickerProps,
|
|
5
|
+
export type { ColorHueScaleProps, ColorPickerProps, ColorPickerTab, ColorToneDefinition, ColorToneProps, ColorToneSelection, ColorToneTarget, ColorWheelProps, ColorWheelSelection, } from './features/color/public';
|
|
6
6
|
export { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';
|
|
7
7
|
export type { MasterDetailActivePane, MasterDetailDesktopMode, MasterDetailMasterWidth, MasterDetailProps, } from './features/master-detail/public';
|
|
8
8
|
export { MasterDetail } from './features/master-detail/public';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,kCAAkC,EAClC,6BAA6B,EAC7B,sCAAsC,EACtC,8BAA8B,EAC9B,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5F,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAYtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAO5F,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAc/D,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,cAAc,cAAc,CAAC","sourcesContent":["export type {\n AuthoringBindingControlState,\n AuthoringBindingEditorAdapterProps,\n AuthoringPropertyControlState,\n AuthoringPropertyInspectorAdapterProps,\n AuthoringSelectionAdapterProps,\n AuthoringSelectionItemState,\n ThemeEditorAdapterProps,\n ThemeRecipeFieldControlState,\n} from './authoring';\nexport {\n AuthoringBindingEditorAdapter,\n AuthoringPropertyInspectorAdapter,\n AuthoringSelectionAdapter,\n ThemeEditorAdapter,\n} from './authoring';\nexport type { CarouselProps, CarouselSlide, CarouselTransition } from './features/carousel/public';\nexport { Carousel } from './features/carousel/public';\nexport type {\n ColorHueScaleProps,\n ColorPickerProps,\n ColorPickerTab,\n ColorToneDefinition,\n ColorToneProps,\n ColorToneSelection,\n ColorToneTarget,\n ColorWheelProps,\n ColorWheelSelection,\n} from './features/color/public';\nexport { ColorHueScale, ColorPicker, ColorTone, ColorWheel } from './features/color/public';\nexport type {\n MasterDetailActivePane,\n MasterDetailDesktopMode,\n MasterDetailMasterWidth,\n MasterDetailProps,\n} from './features/master-detail/public';\nexport { MasterDetail } from './features/master-detail/public';\nexport type {\n ReaderColorScheme,\n ReaderDocumentFormat,\n ReaderErrorCode,\n ReaderErrorEvent,\n ReaderExternalLinkEvent,\n ReaderLineHeight,\n ReaderLocationChangeEvent,\n ReaderNavigationTrigger,\n ReaderProps,\n ReaderResolvedSource,\n ReaderStatus,\n} from './features/reader/public';\nexport { Reader, resolveReaderProgress } from './features/reader/public';\nexport { ZORA_COMPONENT_REGISTRY } from './features/registry/public';\nexport * from './readerFree';\nexport type { ZoraComponentRegistry } from './types/registry';\n"]}
|
package/dist/types/color.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';
|
|
2
2
|
import type { ZoraBaseProps } from './base';
|
|
3
|
-
export type ColorPickerTab = '
|
|
3
|
+
export type ColorPickerTab = 'grid' | 'wheel';
|
|
4
4
|
/** A consumer-owned OKLCH target from the published Templates tone catalog. */
|
|
5
5
|
export interface ColorToneTarget {
|
|
6
6
|
readonly lightness: number;
|
|
@@ -23,26 +23,10 @@ export interface ColorToneSelection {
|
|
|
23
23
|
readonly toneId: string;
|
|
24
24
|
readonly colors: readonly HexColor[];
|
|
25
25
|
}
|
|
26
|
-
/** The persistent, controlled state for every independently selectable picker mode. */
|
|
27
|
-
export interface ColorPickerValue {
|
|
28
|
-
readonly tab: ColorPickerTab;
|
|
29
|
-
readonly wheel: ColorWheelSelection;
|
|
30
|
-
readonly tone: ColorToneSelection | null;
|
|
31
|
-
readonly hue: HexColor;
|
|
32
|
-
}
|
|
33
|
-
/** A single mode-specific update emitted by the composed picker. */
|
|
34
|
-
export type ColorPickerSelection = {
|
|
35
|
-
readonly mode: 'wheel';
|
|
36
|
-
readonly value: ColorWheelSelection;
|
|
37
|
-
} | {
|
|
38
|
-
readonly mode: 'tone';
|
|
39
|
-
readonly value: ColorToneSelection;
|
|
40
|
-
} | {
|
|
41
|
-
readonly mode: 'hue';
|
|
42
|
-
readonly value: HexColor;
|
|
43
|
-
};
|
|
44
26
|
export interface ColorWheelProps extends ZoraBaseProps {
|
|
45
27
|
readonly value: HexColor;
|
|
28
|
+
/** Square stage side derived by the owning ColorPicker geometry. */
|
|
29
|
+
readonly size?: number;
|
|
46
30
|
readonly harmony?: ColorHarmony | null;
|
|
47
31
|
readonly harmonies?: readonly ColorHarmony[];
|
|
48
32
|
readonly onChange: (selection: ColorWheelSelection) => void;
|
|
@@ -58,15 +42,31 @@ export interface ColorHueScaleProps extends ZoraBaseProps {
|
|
|
58
42
|
readonly onChange: (color: HexColor) => void;
|
|
59
43
|
}
|
|
60
44
|
export interface ColorPickerProps extends ZoraBaseProps {
|
|
61
|
-
|
|
62
|
-
readonly
|
|
63
|
-
|
|
64
|
-
readonly
|
|
45
|
+
/** Enabled presentations, in Grid then Wheel order by default. */
|
|
46
|
+
readonly tabs?: readonly ColorPickerTab[];
|
|
47
|
+
/** The one authoritative selected colour. */
|
|
48
|
+
readonly primaryColor: HexColor;
|
|
49
|
+
/** Optional owner-provided harmony applied to both presentations. */
|
|
50
|
+
readonly harmony?: ColorHarmony;
|
|
51
|
+
/** Optional consumer-owned tone-family id. */
|
|
52
|
+
readonly tone?: string;
|
|
53
|
+
/** Consumer-owned tone catalogue; ZORA deliberately does not copy it. */
|
|
54
|
+
readonly tones?: readonly ColorToneDefinition[];
|
|
55
|
+
/** Requested outer logical width; hosts must provide at least 360 logical pixels. */
|
|
56
|
+
readonly width?: number;
|
|
57
|
+
/** Controlled active presentation. */
|
|
58
|
+
readonly activeTab?: ColorPickerTab;
|
|
59
|
+
/** Emits one canonical controlled selection payload. */
|
|
60
|
+
readonly onValueChange: (value: {
|
|
61
|
+
readonly primaryColor: HexColor;
|
|
62
|
+
readonly harmony?: ColorHarmony;
|
|
63
|
+
readonly tone?: string;
|
|
64
|
+
}) => void;
|
|
65
|
+
/** Notifies a consumer that a controlled active presentation must change. */
|
|
66
|
+
readonly onActiveTabChange?: (tab: ColorPickerTab) => void;
|
|
65
67
|
/** Requests dismissal from the owning Popover or BottomSheet presentation. */
|
|
66
68
|
readonly onDismiss?: () => void;
|
|
67
69
|
readonly hideTabListWhenSingle?: boolean;
|
|
68
|
-
readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value'>;
|
|
69
|
-
readonly tone?: Omit<ColorToneProps, 'onChange' | 'value'>;
|
|
70
|
-
readonly hue?: Omit<ColorHueScaleProps, 'onChange' | 'value'>;
|
|
70
|
+
readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value' | 'harmony'>;
|
|
71
71
|
}
|
|
72
72
|
//# sourceMappingURL=color.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9C,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,E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aAAa;IACrD,kEAAkE;IAClE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC1C,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;IAChC,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;IAChC,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAChD,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;IACpC,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE;QAC9B,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;QAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;QAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,KAAK,IAAI,CAAC;IACX,6EAA6E;IAC7E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3D,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC1E"}
|
package/dist/types/color.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ColorPickerTab = '
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../src/types/color.ts"],"names":[],"mappings":"","sourcesContent":["import type { ColorHarmony, HexColor } from '@ankhorage/color-theory';\n\nimport type { ZoraBaseProps } from './base';\n\nexport type ColorPickerTab = 'grid' | 'wheel';\n\n/** A consumer-owned OKLCH target from the published Templates tone catalog. */\nexport interface ColorToneTarget {\n readonly lightness: number;\n readonly chroma: number;\n}\n\n/**\n * Structural boundary for a Templates tone-pair entry. ZORA intentionally owns\n * neither the catalog nor its classifications.\n */\nexport interface ColorToneDefinition {\n readonly id: string;\n readonly accent: string;\n readonly accentTarget: ColorToneTarget;\n}\n\nexport interface ColorWheelSelection {\n readonly color: HexColor;\n readonly harmony: ColorHarmony | null;\n}\n\nexport interface ColorToneSelection {\n readonly toneId: string;\n readonly colors: readonly HexColor[];\n}\n\nexport interface ColorWheelProps extends ZoraBaseProps {\n readonly value: HexColor;\n /** Square stage side derived by the owning ColorPicker geometry. */\n readonly size?: number;\n readonly harmony?: ColorHarmony | null;\n readonly harmonies?: readonly ColorHarmony[];\n readonly onChange: (selection: ColorWheelSelection) => void;\n}\n\nexport interface ColorToneProps extends ZoraBaseProps {\n readonly tones: readonly ColorToneDefinition[];\n readonly selectionMode?: 'single' | 'multiple';\n readonly value: ColorToneSelection | null;\n readonly onChange: (selection: ColorToneSelection) => void;\n}\n\nexport interface ColorHueScaleProps extends ZoraBaseProps {\n readonly value: HexColor;\n readonly onChange: (color: HexColor) => void;\n}\n\nexport interface ColorPickerProps extends ZoraBaseProps {\n /** Enabled presentations, in Grid then Wheel order by default. */\n readonly tabs?: readonly ColorPickerTab[];\n /** The one authoritative selected colour. */\n readonly primaryColor: HexColor;\n /** Optional owner-provided harmony applied to both presentations. */\n readonly harmony?: ColorHarmony;\n /** Optional consumer-owned tone-family id. */\n readonly tone?: string;\n /** Consumer-owned tone catalogue; ZORA deliberately does not copy it. */\n readonly tones?: readonly ColorToneDefinition[];\n /** Requested outer logical width; hosts must provide at least 360 logical pixels. */\n readonly width?: number;\n /** Controlled active presentation. */\n readonly activeTab?: ColorPickerTab;\n /** Emits one canonical controlled selection payload. */\n readonly onValueChange: (value: {\n readonly primaryColor: HexColor;\n readonly harmony?: ColorHarmony;\n readonly tone?: string;\n }) => void;\n /** Notifies a consumer that a controlled active presentation must change. */\n readonly onActiveTabChange?: (tab: ColorPickerTab) => void;\n /** Requests dismissal from the owning Popover or BottomSheet presentation. */\n readonly onDismiss?: () => void;\n readonly hideTabListWhenSingle?: boolean;\n readonly wheel?: Omit<ColorWheelProps, 'onChange' | 'value' | 'harmony'>;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "28.0.0",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@ankhorage/graph": "^0.4.0",
|
|
49
49
|
"@ankhorage/grid-view": "^0.5.0",
|
|
50
50
|
"@ankhorage/reader": "^0.1.3",
|
|
51
|
-
"@ankhorage/runtime": "^5.6.
|
|
51
|
+
"@ankhorage/runtime": "^5.6.4",
|
|
52
52
|
"@ankhorage/surface": "^9.7.2",
|
|
53
53
|
"@ankhorage/utility": "^1.11.0",
|
|
54
54
|
"expo-document-picker": "~57.0.3",
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
},
|
|
189
189
|
"devDependencies": {
|
|
190
190
|
"@ankhorage/devtools": "^2.11.1",
|
|
191
|
-
"@ankhorage/paradox": "^0.6.
|
|
191
|
+
"@ankhorage/paradox": "^0.6.1",
|
|
192
192
|
"@react-native-vector-icons/fontawesome": "^14.0.0",
|
|
193
193
|
"@react-native-vector-icons/fontawesome5": "^14.0.0",
|
|
194
194
|
"@react-native-vector-icons/fontawesome6": "^14.0.0",
|
|
@@ -2,11 +2,10 @@ import { type HexColor, isHexColor } from '@ankhorage/color-theory';
|
|
|
2
2
|
import { TextInput } from '@ankhorage/surface';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { Icon } from '../icon/public';
|
|
6
5
|
import { View } from '../layout/public';
|
|
7
6
|
import { useZoraTheme } from '../theme/composition/useZoraTheme';
|
|
8
7
|
|
|
9
|
-
/*** Edits one controlled HEX color
|
|
8
|
+
/*** Edits one controlled HEX color until the host-backed clipboard capability is available. */
|
|
10
9
|
export function ColorHexField({
|
|
11
10
|
disabled,
|
|
12
11
|
onChange,
|
|
@@ -38,7 +37,6 @@ export function ColorHexField({
|
|
|
38
37
|
setInput(nextValue);
|
|
39
38
|
if (isHexColor(nextValue)) onChange(nextValue);
|
|
40
39
|
}}
|
|
41
|
-
trailingAccessory={<Icon color="textMuted" name="copy-outline" size="m" />}
|
|
42
40
|
value={input}
|
|
43
41
|
/>
|
|
44
42
|
);
|
|
@@ -15,7 +15,7 @@ function load(path: string) {
|
|
|
15
15
|
return import(pathToFileURL(join(webDistRoot, path)).href);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
test('
|
|
18
|
+
test('renders the same 8-by-8 Grid geometry in both inherited theme modes', async () => {
|
|
19
19
|
const [{ ColorPicker }, { ZoraProvider }] = (await Promise.all([
|
|
20
20
|
load('components/color-picker/index.js'),
|
|
21
21
|
load('runtime/ZoraProvider.js'),
|
|
@@ -33,17 +33,11 @@ test('keeps the selected hue grid inside the responsive picker surface in both t
|
|
|
33
33
|
renderToStaticMarkup(
|
|
34
34
|
<ZoraProvider mode={mode}>
|
|
35
35
|
<ColorPicker
|
|
36
|
-
hue={{}}
|
|
37
36
|
onDismiss={() => undefined}
|
|
38
37
|
onValueChange={() => undefined}
|
|
39
|
-
|
|
38
|
+
primaryColor="#2563eb"
|
|
40
39
|
testID={`picker-${mode}`}
|
|
41
|
-
|
|
42
|
-
hue: '#2563eb',
|
|
43
|
-
tab: 'hue',
|
|
44
|
-
tone: null,
|
|
45
|
-
wheel: { color: '#2563eb', harmony: null },
|
|
46
|
-
}}
|
|
40
|
+
width={560}
|
|
47
41
|
/>
|
|
48
42
|
</ZoraProvider>,
|
|
49
43
|
);
|
|
@@ -53,17 +47,18 @@ test('keeps the selected hue grid inside the responsive picker surface in both t
|
|
|
53
47
|
browser.document.body.innerHTML = markupFor(mode);
|
|
54
48
|
try {
|
|
55
49
|
const picker = browser.document.querySelector(`[data-testid="picker-${mode}"]`);
|
|
56
|
-
const
|
|
57
|
-
const swatches =
|
|
50
|
+
const grid = browser.document.querySelector('[aria-label="Color grid"]');
|
|
51
|
+
const swatches = grid?.querySelectorAll('[role="button"]') ?? [];
|
|
58
52
|
|
|
59
|
-
expect(picker?.getAttribute('style')).toContain('width:
|
|
60
|
-
expect(picker?.getAttribute('style')).toContain('max-width:400px');
|
|
53
|
+
expect(picker?.getAttribute('style')).toContain('width:560px');
|
|
61
54
|
expect(browser.document.querySelector('[aria-label="Close color picker"]')).not.toBeNull();
|
|
62
55
|
expect(browser.document.querySelectorAll('[aria-label="Color hex value"]')).toHaveLength(1);
|
|
63
|
-
expect(
|
|
64
|
-
expect(swatches).toHaveLength(
|
|
56
|
+
expect(grid?.getAttribute('style')).toContain('flex-wrap:wrap');
|
|
57
|
+
expect(swatches).toHaveLength(64);
|
|
65
58
|
expect(
|
|
66
|
-
Array.from(swatches).every((swatch) =>
|
|
59
|
+
Array.from(swatches).every((swatch) =>
|
|
60
|
+
swatch.getAttribute('style')?.includes('width:38.125px'),
|
|
61
|
+
),
|
|
67
62
|
).toBe(true);
|
|
68
63
|
} finally {
|
|
69
64
|
browser.close();
|