@easyops-cn/a2ui-react 0.0.0 → 0.0.2
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/README.md +12 -8
- package/dist/0.8/A2UIRenderer.d.ts +49 -0
- package/dist/0.8/A2UIRenderer.test.d.ts +6 -0
- package/dist/0.8/components/ComponentRenderer.d.ts +39 -0
- package/dist/0.8/components/ComponentRenderer.test.d.ts +6 -0
- package/dist/0.8/components/UnknownComponent.d.ts +18 -0
- package/dist/0.8/components/display/AudioPlayerComponent.d.ts +5 -0
- package/dist/0.8/components/display/DividerComponent.d.ts +5 -0
- package/dist/0.8/components/display/IconComponent.d.ts +5 -0
- package/dist/0.8/components/display/ImageComponent.d.ts +6 -0
- package/dist/0.8/components/display/TextComponent.d.ts +6 -0
- package/dist/0.8/components/display/VideoComponent.d.ts +5 -0
- package/dist/0.8/components/display/display.test.d.ts +7 -0
- package/dist/0.8/components/display/index.d.ts +9 -0
- package/dist/0.8/components/index.d.ts +7 -0
- package/dist/0.8/components/interactive/ButtonComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/CheckBoxComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/DateTimeInputComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/MultipleChoiceComponent.d.ts +7 -0
- package/dist/0.8/components/interactive/SliderComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/TextFieldComponent.d.ts +5 -0
- package/dist/0.8/components/interactive/index.d.ts +9 -0
- package/dist/0.8/components/interactive/interactive.test.d.ts +7 -0
- package/dist/0.8/components/layout/CardComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ColumnComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ListComponent.d.ts +5 -0
- package/dist/0.8/components/layout/ModalComponent.d.ts +5 -0
- package/dist/0.8/components/layout/RowComponent.d.ts +5 -0
- package/dist/0.8/components/layout/TabsComponent.d.ts +5 -0
- package/dist/0.8/components/layout/index.d.ts +9 -0
- package/dist/0.8/components/layout/layout.test.d.ts +7 -0
- package/dist/0.8/contexts/A2UIProvider.d.ts +34 -0
- package/dist/0.8/contexts/A2UIProvider.test.d.ts +6 -0
- package/dist/0.8/contexts/ActionContext.d.ts +33 -0
- package/dist/0.8/contexts/ActionContext.test.d.ts +6 -0
- package/dist/0.8/contexts/ComponentsMapContext.d.ts +63 -0
- package/dist/0.8/contexts/DataModelContext.d.ts +43 -0
- package/dist/0.8/contexts/DataModelContext.test.d.ts +6 -0
- package/dist/0.8/contexts/SurfaceContext.d.ts +45 -0
- package/dist/0.8/contexts/SurfaceContext.test.d.ts +6 -0
- package/dist/0.8/hooks/useA2UIMessageHandler.d.ts +41 -0
- package/dist/0.8/hooks/useA2UIMessageHandler.test.d.ts +6 -0
- package/{src/0.8/hooks/useComponent.ts → dist/0.8/hooks/useComponent.d.ts} +2 -18
- package/dist/0.8/hooks/useComponent.test.d.ts +6 -0
- package/dist/0.8/hooks/useDataBinding.d.ts +50 -0
- package/dist/0.8/hooks/useDataBinding.test.d.ts +6 -0
- package/{src/0.8/hooks/useDispatchAction.ts → dist/0.8/hooks/useDispatchAction.d.ts} +2 -15
- package/dist/0.8/hooks/useDispatchAction.test.d.ts +6 -0
- package/{src/0.8/hooks/useSurface.ts → dist/0.8/hooks/useSurface.d.ts} +2 -15
- package/dist/0.8/hooks/useSurface.test.d.ts +6 -0
- package/{src/0.8/index.ts → dist/0.8/index.d.ts} +7 -21
- package/{src/0.8/types/index.ts → dist/0.8/types/index.d.ts} +128 -213
- package/dist/0.8/utils/dataBinding.d.ts +95 -0
- package/dist/0.8/utils/dataBinding.test.d.ts +6 -0
- package/dist/0.8/utils/pathUtils.d.ts +63 -0
- package/dist/0.8/utils/pathUtils.test.d.ts +6 -0
- package/dist/a2ui-react.js +4 -0
- package/dist/a2ui-react10.js +54 -0
- package/dist/a2ui-react100.js +24 -0
- package/dist/a2ui-react101.js +255 -0
- package/dist/a2ui-react102.js +163 -0
- package/dist/a2ui-react103.js +19 -0
- package/dist/a2ui-react104.js +251 -0
- package/dist/a2ui-react105.js +61 -0
- package/dist/a2ui-react106.js +35 -0
- package/dist/a2ui-react107.js +436 -0
- package/dist/a2ui-react108.js +16 -0
- package/dist/a2ui-react109.js +234 -0
- package/dist/a2ui-react11.js +9 -0
- package/dist/a2ui-react110.js +6 -0
- package/dist/a2ui-react111.js +6 -0
- package/dist/a2ui-react112.js +6 -0
- package/dist/a2ui-react113.js +239 -0
- package/dist/a2ui-react114.js +845 -0
- package/dist/a2ui-react115.js +6 -0
- package/dist/a2ui-react116.js +10 -0
- package/dist/a2ui-react117.js +8 -0
- package/dist/a2ui-react118.js +8 -0
- package/dist/a2ui-react119.js +20 -0
- package/dist/a2ui-react12.js +32 -0
- package/dist/a2ui-react120.js +8 -0
- package/dist/a2ui-react121.js +8 -0
- package/dist/a2ui-react122.js +9 -0
- package/dist/a2ui-react123.js +16 -0
- package/dist/a2ui-react124.js +18 -0
- package/dist/a2ui-react125.js +11 -0
- package/dist/a2ui-react126.js +9 -0
- package/dist/a2ui-react127.js +13 -0
- package/dist/a2ui-react128.js +17 -0
- package/dist/a2ui-react129.js +8 -0
- package/dist/a2ui-react13.js +36 -0
- package/dist/a2ui-react130.js +17 -0
- package/dist/a2ui-react131.js +8 -0
- package/dist/a2ui-react132.js +10 -0
- package/dist/a2ui-react133.js +9 -0
- package/dist/a2ui-react134.js +7 -0
- package/dist/a2ui-react135.js +9 -0
- package/dist/a2ui-react136.js +548 -0
- package/dist/a2ui-react137.js +49 -0
- package/dist/a2ui-react138.js +20 -0
- package/dist/a2ui-react139.js +21 -0
- package/dist/a2ui-react14.js +114 -0
- package/dist/a2ui-react140.js +11 -0
- package/dist/a2ui-react141.js +9 -0
- package/dist/a2ui-react142.js +10 -0
- package/dist/a2ui-react143.js +8 -0
- package/dist/a2ui-react144.js +9 -0
- package/dist/a2ui-react145.js +12 -0
- package/dist/a2ui-react146.js +8 -0
- package/dist/a2ui-react147.js +11 -0
- package/dist/a2ui-react148.js +15 -0
- package/dist/a2ui-react149.js +8 -0
- package/dist/a2ui-react15.js +18 -0
- package/dist/a2ui-react150.js +12 -0
- package/dist/a2ui-react151.js +10 -0
- package/dist/a2ui-react152.js +12 -0
- package/dist/a2ui-react153.js +16 -0
- package/dist/a2ui-react154.js +8 -0
- package/dist/a2ui-react155.js +8 -0
- package/dist/a2ui-react156.js +8 -0
- package/dist/a2ui-react157.js +7 -0
- package/dist/a2ui-react158.js +14 -0
- package/dist/a2ui-react159.js +13 -0
- package/dist/a2ui-react16.js +19 -0
- package/dist/a2ui-react160.js +13 -0
- package/dist/a2ui-react161.js +14 -0
- package/dist/a2ui-react162.js +14 -0
- package/dist/a2ui-react163.js +35 -0
- package/dist/a2ui-react164.js +67 -0
- package/dist/a2ui-react165.js +11 -0
- package/dist/a2ui-react166.js +11 -0
- package/dist/a2ui-react167.js +10 -0
- package/dist/a2ui-react168.js +13 -0
- package/dist/a2ui-react169.js +10 -0
- package/dist/a2ui-react17.js +18 -0
- package/dist/a2ui-react170.js +10 -0
- package/dist/a2ui-react171.js +9 -0
- package/dist/a2ui-react172.js +17 -0
- package/dist/a2ui-react173.js +21 -0
- package/dist/a2ui-react174.js +18 -0
- package/dist/a2ui-react175.js +35 -0
- package/dist/a2ui-react176.js +14 -0
- package/dist/a2ui-react177.js +7 -0
- package/dist/a2ui-react178.js +58 -0
- package/dist/a2ui-react179.js +25 -0
- package/dist/a2ui-react18.js +58 -0
- package/dist/a2ui-react180.js +43 -0
- package/dist/a2ui-react181.js +63 -0
- package/dist/a2ui-react182.js +34 -0
- package/dist/a2ui-react183.js +15 -0
- package/dist/a2ui-react184.js +67 -0
- package/dist/a2ui-react185.js +67 -0
- package/dist/a2ui-react186.js +69 -0
- package/dist/a2ui-react187.js +69 -0
- package/dist/a2ui-react188.js +42 -0
- package/dist/a2ui-react189.js +43 -0
- package/dist/a2ui-react19.js +58 -0
- package/dist/a2ui-react190.js +55 -0
- package/dist/a2ui-react191.js +45 -0
- package/dist/a2ui-react192.js +41 -0
- package/dist/a2ui-react193.js +72 -0
- package/dist/a2ui-react194.js +72 -0
- package/dist/a2ui-react195.js +97 -0
- package/dist/a2ui-react196.js +42 -0
- package/dist/a2ui-react197.js +42 -0
- package/dist/a2ui-react198.js +42 -0
- package/dist/a2ui-react199.js +27 -0
- package/dist/a2ui-react2.js +11 -0
- package/dist/a2ui-react20.js +51 -0
- package/dist/a2ui-react200.js +26 -0
- package/dist/a2ui-react201.js +26 -0
- package/dist/a2ui-react202.js +27 -0
- package/dist/a2ui-react203.js +26 -0
- package/dist/a2ui-react204.js +26 -0
- package/dist/a2ui-react205.js +16 -0
- package/dist/a2ui-react206.js +41 -0
- package/dist/a2ui-react207.js +41 -0
- package/dist/a2ui-react208.js +16 -0
- package/dist/a2ui-react209.js +16 -0
- package/dist/a2ui-react21.js +14 -0
- package/dist/a2ui-react210.js +32 -0
- package/dist/a2ui-react211.js +32 -0
- package/dist/a2ui-react212.js +6 -0
- package/dist/a2ui-react213.js +9 -0
- package/dist/a2ui-react214.js +50 -0
- package/dist/a2ui-react215.js +29 -0
- package/dist/a2ui-react216.js +68 -0
- package/dist/a2ui-react217.js +10 -0
- package/dist/a2ui-react218.js +127 -0
- package/dist/a2ui-react219.js +17 -0
- package/dist/a2ui-react22.js +29 -0
- package/dist/a2ui-react220.js +136 -0
- package/dist/a2ui-react221.js +13 -0
- package/dist/a2ui-react222.js +219 -0
- package/dist/a2ui-react223.js +15 -0
- package/dist/a2ui-react224.js +36 -0
- package/dist/a2ui-react225.js +49 -0
- package/dist/a2ui-react226.js +10 -0
- package/dist/a2ui-react227.js +52 -0
- package/dist/a2ui-react228.js +6 -0
- package/dist/a2ui-react229.js +8 -0
- package/dist/a2ui-react23.js +25 -0
- package/dist/a2ui-react230.js +30 -0
- package/dist/a2ui-react231.js +52 -0
- package/dist/a2ui-react232.js +11 -0
- package/dist/a2ui-react233.js +70 -0
- package/dist/a2ui-react234.js +49 -0
- package/dist/a2ui-react235.js +27 -0
- package/dist/a2ui-react236.js +49 -0
- package/dist/a2ui-react237.js +183 -0
- package/dist/a2ui-react238.js +70 -0
- package/dist/a2ui-react239.js +33 -0
- package/dist/a2ui-react24.js +29 -0
- package/dist/a2ui-react240.js +11 -0
- package/dist/a2ui-react241.js +155 -0
- package/dist/a2ui-react242.js +110 -0
- package/dist/a2ui-react243.js +22 -0
- package/dist/a2ui-react244.js +100 -0
- package/dist/a2ui-react245.js +49 -0
- package/dist/a2ui-react246.js +14 -0
- package/dist/a2ui-react247.js +208 -0
- package/dist/a2ui-react248.js +24 -0
- package/dist/a2ui-react249.js +402 -0
- package/dist/a2ui-react25.js +27 -0
- package/dist/a2ui-react250.js +49 -0
- package/dist/a2ui-react251.js +49 -0
- package/dist/a2ui-react252.js +54 -0
- package/dist/a2ui-react253.js +7 -0
- package/dist/a2ui-react254.js +7 -0
- package/dist/a2ui-react255.js +18 -0
- package/dist/a2ui-react256.js +8 -0
- package/dist/a2ui-react257.js +10 -0
- package/dist/a2ui-react258.js +19 -0
- package/dist/a2ui-react259.js +7 -0
- package/dist/a2ui-react26.js +44 -0
- package/dist/a2ui-react260.js +7 -0
- package/dist/a2ui-react261.js +8 -0
- package/dist/a2ui-react262.js +8 -0
- package/dist/a2ui-react263.js +7 -0
- package/dist/a2ui-react264.js +7 -0
- package/dist/a2ui-react265.js +9 -0
- package/dist/a2ui-react266.js +27 -0
- package/dist/a2ui-react267.js +9 -0
- package/dist/a2ui-react268.js +7 -0
- package/dist/a2ui-react269.js +9 -0
- package/dist/a2ui-react27.js +100 -0
- package/dist/a2ui-react270.js +8 -0
- package/dist/a2ui-react271.js +7 -0
- package/dist/a2ui-react272.js +8 -0
- package/dist/a2ui-react273.js +7 -0
- package/dist/a2ui-react274.js +11 -0
- package/dist/a2ui-react275.js +8 -0
- package/dist/a2ui-react276.js +7 -0
- package/dist/a2ui-react277.js +7 -0
- package/dist/a2ui-react278.js +9 -0
- package/dist/a2ui-react279.js +148 -0
- package/dist/a2ui-react28.js +82 -0
- package/dist/a2ui-react280.js +42 -0
- package/dist/a2ui-react281.js +7 -0
- package/dist/a2ui-react282.js +10 -0
- package/dist/a2ui-react283.js +16 -0
- package/dist/a2ui-react284.js +10 -0
- package/dist/a2ui-react285.js +34 -0
- package/dist/a2ui-react286.js +13 -0
- package/dist/a2ui-react287.js +13 -0
- package/dist/a2ui-react288.js +11 -0
- package/dist/a2ui-react289.js +16 -0
- package/dist/a2ui-react29.js +43 -0
- package/dist/a2ui-react290.js +104 -0
- package/dist/a2ui-react291.js +22 -0
- package/dist/a2ui-react292.js +56 -0
- package/dist/a2ui-react293.js +75 -0
- package/dist/a2ui-react294.js +12 -0
- package/dist/a2ui-react295.js +23 -0
- package/dist/a2ui-react296.js +19 -0
- package/dist/a2ui-react297.js +26 -0
- package/dist/a2ui-react298.js +9 -0
- package/dist/a2ui-react299.js +8 -0
- package/dist/a2ui-react3.js +40 -0
- package/dist/a2ui-react30.js +41 -0
- package/dist/a2ui-react300.js +26 -0
- package/dist/a2ui-react301.js +37 -0
- package/dist/a2ui-react302.js +18 -0
- package/dist/a2ui-react303.js +9 -0
- package/dist/a2ui-react304.js +7 -0
- package/dist/a2ui-react305.js +7 -0
- package/dist/a2ui-react306.js +7 -0
- package/dist/a2ui-react307.js +7 -0
- package/dist/a2ui-react308.js +6 -0
- package/dist/a2ui-react309.js +9 -0
- package/dist/a2ui-react31.js +86 -0
- package/dist/a2ui-react310.js +26 -0
- package/dist/a2ui-react311.js +10 -0
- package/dist/a2ui-react312.js +9 -0
- package/dist/a2ui-react313.js +8 -0
- package/dist/a2ui-react314.js +6 -0
- package/dist/a2ui-react315.js +6 -0
- package/dist/a2ui-react316.js +7 -0
- package/dist/a2ui-react317.js +6 -0
- package/dist/a2ui-react318.js +7 -0
- package/dist/a2ui-react319.js +6 -0
- package/dist/a2ui-react32.js +46 -0
- package/dist/a2ui-react320.js +6 -0
- package/dist/a2ui-react321.js +6 -0
- package/dist/a2ui-react322.js +9 -0
- package/dist/a2ui-react323.js +18 -0
- package/dist/a2ui-react324.js +31 -0
- package/dist/a2ui-react325.js +15 -0
- package/dist/a2ui-react326.js +27 -0
- package/dist/a2ui-react327.js +31 -0
- package/dist/a2ui-react328.js +7 -0
- package/dist/a2ui-react329.js +19 -0
- package/dist/a2ui-react33.js +44 -0
- package/dist/a2ui-react330.js +8 -0
- package/dist/a2ui-react331.js +8 -0
- package/dist/a2ui-react332.js +61 -0
- package/dist/a2ui-react333.js +69 -0
- package/dist/a2ui-react334.js +9 -0
- package/dist/a2ui-react335.js +7 -0
- package/dist/a2ui-react336.js +26 -0
- package/dist/a2ui-react337.js +19 -0
- package/dist/a2ui-react338.js +10 -0
- package/dist/a2ui-react339.js +13 -0
- package/dist/a2ui-react34.js +8 -0
- package/dist/a2ui-react340.js +13 -0
- package/dist/a2ui-react341.js +24 -0
- package/dist/a2ui-react342.js +13 -0
- package/dist/a2ui-react343.js +12 -0
- package/dist/a2ui-react344.js +12 -0
- package/dist/a2ui-react345.js +7 -0
- package/dist/a2ui-react346.js +8 -0
- package/dist/a2ui-react347.js +19 -0
- package/dist/a2ui-react348.js +12 -0
- package/dist/a2ui-react349.js +21 -0
- package/dist/a2ui-react35.js +16 -0
- package/dist/a2ui-react350.js +18 -0
- package/dist/a2ui-react351.js +15 -0
- package/dist/a2ui-react352.js +32 -0
- package/dist/a2ui-react353.js +15 -0
- package/dist/a2ui-react354.js +28 -0
- package/dist/a2ui-react355.js +8 -0
- package/dist/a2ui-react356.js +11 -0
- package/dist/a2ui-react357.js +22 -0
- package/dist/a2ui-react358.js +7 -0
- package/dist/a2ui-react359.js +5 -0
- package/dist/a2ui-react36.js +23 -0
- package/dist/a2ui-react360.js +26 -0
- package/dist/a2ui-react361.js +115 -0
- package/dist/a2ui-react362.js +18 -0
- package/dist/a2ui-react363.js +527 -0
- package/dist/a2ui-react364.js +130 -0
- package/dist/a2ui-react365.js +136 -0
- package/dist/a2ui-react366.js +7 -0
- package/dist/a2ui-react367.js +15 -0
- package/dist/a2ui-react368.js +67 -0
- package/dist/a2ui-react369.js +71 -0
- package/dist/a2ui-react37.js +15 -0
- package/dist/a2ui-react370.js +11 -0
- package/dist/a2ui-react371.js +16 -0
- package/dist/a2ui-react372.js +68 -0
- package/dist/a2ui-react373.js +6 -0
- package/dist/a2ui-react374.js +25 -0
- package/dist/a2ui-react375.js +15 -0
- package/dist/a2ui-react376.js +30 -0
- package/dist/a2ui-react377.js +7 -0
- package/dist/a2ui-react378.js +25 -0
- package/dist/a2ui-react38.js +10 -0
- package/dist/a2ui-react39.js +10 -0
- package/dist/a2ui-react4.js +76 -0
- package/dist/a2ui-react40.js +14 -0
- package/dist/a2ui-react41.js +14 -0
- package/dist/a2ui-react42.js +16 -0
- package/dist/a2ui-react43.js +12 -0
- package/dist/a2ui-react44.js +15 -0
- package/dist/a2ui-react45.js +15 -0
- package/dist/a2ui-react46.js +9 -0
- package/dist/a2ui-react47.js +11 -0
- package/dist/a2ui-react48.js +16 -0
- package/dist/a2ui-react49.js +10 -0
- package/dist/a2ui-react5.js +8 -0
- package/dist/a2ui-react50.js +14 -0
- package/dist/a2ui-react51.js +9 -0
- package/dist/a2ui-react52.js +9 -0
- package/dist/a2ui-react53.js +15 -0
- package/dist/a2ui-react54.js +17 -0
- package/dist/a2ui-react55.js +10 -0
- package/dist/a2ui-react56.js +10 -0
- package/dist/a2ui-react57.js +10 -0
- package/dist/a2ui-react58.js +9 -0
- package/dist/a2ui-react59.js +9 -0
- package/dist/a2ui-react6.js +28 -0
- package/dist/a2ui-react60.js +9 -0
- package/dist/a2ui-react61.js +15 -0
- package/dist/a2ui-react62.js +10 -0
- package/dist/a2ui-react63.js +15 -0
- package/dist/a2ui-react64.js +10 -0
- package/dist/a2ui-react65.js +14 -0
- package/dist/a2ui-react66.js +22 -0
- package/dist/a2ui-react67.js +14 -0
- package/dist/a2ui-react68.js +10 -0
- package/dist/a2ui-react69.js +17 -0
- package/dist/a2ui-react7.js +10 -0
- package/dist/a2ui-react70.js +15 -0
- package/dist/a2ui-react71.js +10 -0
- package/dist/a2ui-react72.js +12 -0
- package/dist/a2ui-react73.js +9 -0
- package/dist/a2ui-react74.js +6 -0
- package/dist/a2ui-react75.js +15 -0
- package/dist/a2ui-react76.js +11 -0
- package/dist/a2ui-react77.js +14 -0
- package/dist/a2ui-react78.js +9 -0
- package/dist/a2ui-react79.js +9 -0
- package/dist/a2ui-react8.js +21 -0
- package/dist/a2ui-react80.js +9 -0
- package/dist/a2ui-react81.js +10 -0
- package/dist/a2ui-react82.js +26 -0
- package/dist/a2ui-react83.js +29 -0
- package/dist/a2ui-react84.js +67 -0
- package/dist/a2ui-react85.js +77 -0
- package/dist/a2ui-react86.js +53 -0
- package/dist/a2ui-react87.js +31 -0
- package/dist/a2ui-react88.js +22 -0
- package/dist/a2ui-react89.js +21 -0
- package/dist/a2ui-react9.js +88 -0
- package/{src/components/ui/textarea.tsx → dist/a2ui-react90.js} +17 -17
- package/dist/a2ui-react91.js +176 -0
- package/dist/a2ui-react92.js +38 -0
- package/dist/a2ui-react93.js +88 -0
- package/dist/a2ui-react94.js +9 -0
- package/dist/a2ui-react95.js +58 -0
- package/dist/a2ui-react96.js +146 -0
- package/dist/a2ui-react97.js +63 -0
- package/dist/a2ui-react98.js +17 -0
- package/dist/a2ui-react99.js +2765 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/calendar.d.ts +8 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/dialog.d.ts +15 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/native-select.d.ts +7 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/tabs.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/package.json +10 -2
- package/.claude/commands/speckit.analyze.md +0 -184
- package/.claude/commands/speckit.checklist.md +0 -294
- package/.claude/commands/speckit.clarify.md +0 -181
- package/.claude/commands/speckit.constitution.md +0 -82
- package/.claude/commands/speckit.implement.md +0 -135
- package/.claude/commands/speckit.plan.md +0 -89
- package/.claude/commands/speckit.specify.md +0 -256
- package/.claude/commands/speckit.tasks.md +0 -137
- package/.claude/commands/speckit.taskstoissues.md +0 -30
- package/.github/workflows/deploy.yml +0 -69
- package/.husky/pre-commit +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc +0 -7
- package/.specify/memory/constitution.md +0 -73
- package/.specify/scripts/bash/check-prerequisites.sh +0 -166
- package/.specify/scripts/bash/common.sh +0 -156
- package/.specify/scripts/bash/create-new-feature.sh +0 -297
- package/.specify/scripts/bash/setup-plan.sh +0 -61
- package/.specify/scripts/bash/update-agent-context.sh +0 -799
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/plan-template.md +0 -105
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -250
- package/CLAUDE.md +0 -105
- package/CONTRIBUTING.md +0 -97
- package/components.json +0 -21
- package/eslint.config.js +0 -25
- package/netlify.toml +0 -50
- package/playground/README.md +0 -75
- package/playground/index.html +0 -22
- package/playground/package.json +0 -32
- package/playground/public/favicon.svg +0 -8
- package/playground/src/App.css +0 -256
- package/playground/src/App.tsx +0 -115
- package/playground/src/assets/react.svg +0 -1
- package/playground/src/components/ErrorDisplay.tsx +0 -13
- package/playground/src/components/ExampleSelector.tsx +0 -64
- package/playground/src/components/Header.tsx +0 -47
- package/playground/src/components/JsonEditor.tsx +0 -32
- package/playground/src/components/Preview.tsx +0 -78
- package/playground/src/components/ThemeToggle.tsx +0 -19
- package/playground/src/data/examples.ts +0 -1571
- package/playground/src/hooks/useTheme.ts +0 -55
- package/playground/src/index.css +0 -220
- package/playground/src/main.tsx +0 -10
- package/playground/tsconfig.app.json +0 -34
- package/playground/tsconfig.json +0 -13
- package/playground/tsconfig.node.json +0 -26
- package/playground/vite.config.ts +0 -31
- package/specs/001-a2ui-renderer/checklists/requirements.md +0 -41
- package/specs/001-a2ui-renderer/data-model.md +0 -140
- package/specs/001-a2ui-renderer/plan.md +0 -123
- package/specs/001-a2ui-renderer/quickstart.md +0 -141
- package/specs/001-a2ui-renderer/research.md +0 -140
- package/specs/001-a2ui-renderer/spec.md +0 -165
- package/specs/001-a2ui-renderer/tasks.md +0 -310
- package/specs/002-playground/checklists/requirements.md +0 -37
- package/specs/002-playground/contracts/components.md +0 -120
- package/specs/002-playground/data-model.md +0 -149
- package/specs/002-playground/plan.md +0 -73
- package/specs/002-playground/quickstart.md +0 -158
- package/specs/002-playground/research.md +0 -117
- package/specs/002-playground/spec.md +0 -109
- package/specs/002-playground/tasks.md +0 -224
- package/src/0.8/A2UIRender.test.tsx +0 -793
- package/src/0.8/A2UIRender.tsx +0 -142
- package/src/0.8/components/ComponentRenderer.test.tsx +0 -373
- package/src/0.8/components/ComponentRenderer.tsx +0 -163
- package/src/0.8/components/UnknownComponent.tsx +0 -49
- package/src/0.8/components/display/AudioPlayerComponent.tsx +0 -37
- package/src/0.8/components/display/DividerComponent.tsx +0 -23
- package/src/0.8/components/display/IconComponent.tsx +0 -137
- package/src/0.8/components/display/ImageComponent.tsx +0 -57
- package/src/0.8/components/display/TextComponent.tsx +0 -56
- package/src/0.8/components/display/VideoComponent.tsx +0 -31
- package/src/0.8/components/display/display.test.tsx +0 -660
- package/src/0.8/components/display/index.ts +0 -10
- package/src/0.8/components/index.ts +0 -14
- package/src/0.8/components/interactive/ButtonComponent.tsx +0 -44
- package/src/0.8/components/interactive/CheckBoxComponent.tsx +0 -45
- package/src/0.8/components/interactive/DateTimeInputComponent.tsx +0 -176
- package/src/0.8/components/interactive/MultipleChoiceComponent.tsx +0 -157
- package/src/0.8/components/interactive/SliderComponent.tsx +0 -53
- package/src/0.8/components/interactive/TextFieldComponent.tsx +0 -65
- package/src/0.8/components/interactive/index.ts +0 -10
- package/src/0.8/components/interactive/interactive.test.tsx +0 -618
- package/src/0.8/components/layout/CardComponent.tsx +0 -30
- package/src/0.8/components/layout/ColumnComponent.tsx +0 -93
- package/src/0.8/components/layout/ListComponent.tsx +0 -81
- package/src/0.8/components/layout/ModalComponent.tsx +0 -41
- package/src/0.8/components/layout/RowComponent.tsx +0 -94
- package/src/0.8/components/layout/TabsComponent.tsx +0 -59
- package/src/0.8/components/layout/index.ts +0 -10
- package/src/0.8/components/layout/layout.test.tsx +0 -558
- package/src/0.8/contexts/A2UIProvider.test.tsx +0 -226
- package/src/0.8/contexts/A2UIProvider.tsx +0 -54
- package/src/0.8/contexts/ActionContext.test.tsx +0 -242
- package/src/0.8/contexts/ActionContext.tsx +0 -105
- package/src/0.8/contexts/ComponentsMapContext.tsx +0 -125
- package/src/0.8/contexts/DataModelContext.test.tsx +0 -335
- package/src/0.8/contexts/DataModelContext.tsx +0 -184
- package/src/0.8/contexts/SurfaceContext.test.tsx +0 -339
- package/src/0.8/contexts/SurfaceContext.tsx +0 -197
- package/src/0.8/hooks/useA2UIMessageHandler.test.tsx +0 -399
- package/src/0.8/hooks/useA2UIMessageHandler.ts +0 -123
- package/src/0.8/hooks/useComponent.test.tsx +0 -148
- package/src/0.8/hooks/useDataBinding.test.tsx +0 -334
- package/src/0.8/hooks/useDataBinding.ts +0 -99
- package/src/0.8/hooks/useDispatchAction.test.tsx +0 -83
- package/src/0.8/hooks/useSurface.test.tsx +0 -114
- package/src/0.8/schemas/client_to_server.json +0 -50
- package/src/0.8/schemas/server_to_client.json +0 -148
- package/src/0.8/schemas/standard_catalog_definition.json +0 -661
- package/src/0.8/utils/dataBinding.test.ts +0 -443
- package/src/0.8/utils/dataBinding.ts +0 -212
- package/src/0.8/utils/pathUtils.test.ts +0 -353
- package/src/0.8/utils/pathUtils.ts +0 -200
- package/src/components/ui/button.tsx +0 -62
- package/src/components/ui/calendar.tsx +0 -220
- package/src/components/ui/card.tsx +0 -92
- package/src/components/ui/checkbox.tsx +0 -30
- package/src/components/ui/dialog.tsx +0 -141
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -22
- package/src/components/ui/native-select.tsx +0 -53
- package/src/components/ui/popover.tsx +0 -46
- package/src/components/ui/select.tsx +0 -188
- package/src/components/ui/separator.tsx +0 -26
- package/src/components/ui/slider.tsx +0 -61
- package/src/components/ui/tabs.tsx +0 -64
- package/src/index.ts +0 -1
- package/src/lib/utils.ts +0 -6
- package/tsconfig.json +0 -28
- package/vite.config.ts +0 -29
- package/vitest.config.ts +0 -22
- package/vitest.setup.ts +0 -8
- package/website/README.md +0 -4
- package/website/assets/favicon.svg +0 -8
- package/website/content/.gitkeep +0 -0
- package/website/content/index.md +0 -122
- package/website/global.d.ts +0 -9
- package/website/package.json +0 -17
- package/website/plain.config.js +0 -28
- package/website/serve.json +0 -6
- package/website/src/client/color-mode-switch.css +0 -47
- package/website/src/client/index.js +0 -61
- package/website/src/client/moon.svg +0 -1
- package/website/src/client/sun.svg +0 -1
- package/website/src/components/Footer.jsx +0 -9
- package/website/src/components/Header.jsx +0 -44
- package/website/src/components/Page.jsx +0 -28
- package/website/src/global.css +0 -423
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
import * as t from "react";
|
|
2
|
+
import * as be from "react-dom";
|
|
3
|
+
import { clamp as Re } from "./a2ui-react212.js";
|
|
4
|
+
import { composeEventHandlers as R } from "./a2ui-react213.js";
|
|
5
|
+
import { createCollection as ot } from "./a2ui-react214.js";
|
|
6
|
+
import { useComposedRefs as k } from "./a2ui-react215.js";
|
|
7
|
+
import { createContextScope as nt } from "./a2ui-react216.js";
|
|
8
|
+
import { useDirection as rt } from "./a2ui-react217.js";
|
|
9
|
+
import { DismissableLayer as lt } from "./a2ui-react218.js";
|
|
10
|
+
import { useFocusGuards as ct } from "./a2ui-react219.js";
|
|
11
|
+
import { FocusScope as st } from "./a2ui-react220.js";
|
|
12
|
+
import { useId as Ie } from "./a2ui-react221.js";
|
|
13
|
+
import { createPopperScope as _e, Root as it, Anchor as at, Content as dt, Arrow as ut } from "./a2ui-react222.js";
|
|
14
|
+
import { Portal as pt } from "./a2ui-react223.js";
|
|
15
|
+
import { Primitive as M } from "./a2ui-react224.js";
|
|
16
|
+
import { createSlot as ft } from "./a2ui-react225.js";
|
|
17
|
+
import { useCallbackRef as mt } from "./a2ui-react226.js";
|
|
18
|
+
import { useControllableState as Ee } from "./a2ui-react227.js";
|
|
19
|
+
import { useLayoutEffect as Y } from "./a2ui-react228.js";
|
|
20
|
+
import { usePrevious as ht } from "./a2ui-react229.js";
|
|
21
|
+
import { VISUALLY_HIDDEN_STYLES as vt } from "./a2ui-react230.js";
|
|
22
|
+
import { hideOthers as gt } from "./a2ui-react231.js";
|
|
23
|
+
import St from "./a2ui-react232.js";
|
|
24
|
+
import { jsx as p, jsxs as se, Fragment as Te } from "react/jsx-runtime";
|
|
25
|
+
var wt = [" ", "Enter", "ArrowUp", "ArrowDown"], Ct = [" ", "Enter"], J = "Select", [ae, de, xt] = ot(J), [te] = nt(J, [
|
|
26
|
+
xt,
|
|
27
|
+
_e
|
|
28
|
+
]), ue = _e(), [yt, j] = te(J), [It, Tt] = te(J), Ne = (o) => {
|
|
29
|
+
const {
|
|
30
|
+
__scopeSelect: s,
|
|
31
|
+
children: e,
|
|
32
|
+
open: i,
|
|
33
|
+
defaultOpen: l,
|
|
34
|
+
onOpenChange: d,
|
|
35
|
+
value: n,
|
|
36
|
+
defaultValue: r,
|
|
37
|
+
onValueChange: c,
|
|
38
|
+
dir: f,
|
|
39
|
+
name: g,
|
|
40
|
+
autoComplete: C,
|
|
41
|
+
disabled: E,
|
|
42
|
+
required: T,
|
|
43
|
+
form: y
|
|
44
|
+
} = o, a = ue(s), [h, S] = t.useState(null), [m, v] = t.useState(null), [F, A] = t.useState(!1), oe = rt(f), [b, D] = Ee({
|
|
45
|
+
prop: i,
|
|
46
|
+
defaultProp: l ?? !1,
|
|
47
|
+
onChange: d,
|
|
48
|
+
caller: J
|
|
49
|
+
}), [K, X] = Ee({
|
|
50
|
+
prop: n,
|
|
51
|
+
defaultProp: r,
|
|
52
|
+
onChange: c,
|
|
53
|
+
caller: J
|
|
54
|
+
}), B = t.useRef(null), V = h ? y || !!h.closest("form") : !0, [G, H] = t.useState(/* @__PURE__ */ new Set()), U = Array.from(G).map((_) => _.props.value).join(";");
|
|
55
|
+
return /* @__PURE__ */ p(it, { ...a, children: /* @__PURE__ */ se(
|
|
56
|
+
yt,
|
|
57
|
+
{
|
|
58
|
+
required: T,
|
|
59
|
+
scope: s,
|
|
60
|
+
trigger: h,
|
|
61
|
+
onTriggerChange: S,
|
|
62
|
+
valueNode: m,
|
|
63
|
+
onValueNodeChange: v,
|
|
64
|
+
valueNodeHasChildren: F,
|
|
65
|
+
onValueNodeHasChildrenChange: A,
|
|
66
|
+
contentId: Ie(),
|
|
67
|
+
value: K,
|
|
68
|
+
onValueChange: X,
|
|
69
|
+
open: b,
|
|
70
|
+
onOpenChange: D,
|
|
71
|
+
dir: oe,
|
|
72
|
+
triggerPointerDownPosRef: B,
|
|
73
|
+
disabled: E,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ p(ae.Provider, { scope: s, children: /* @__PURE__ */ p(
|
|
76
|
+
It,
|
|
77
|
+
{
|
|
78
|
+
scope: o.__scopeSelect,
|
|
79
|
+
onNativeOptionAdd: t.useCallback((_) => {
|
|
80
|
+
H((L) => new Set(L).add(_));
|
|
81
|
+
}, []),
|
|
82
|
+
onNativeOptionRemove: t.useCallback((_) => {
|
|
83
|
+
H((L) => {
|
|
84
|
+
const W = new Set(L);
|
|
85
|
+
return W.delete(_), W;
|
|
86
|
+
});
|
|
87
|
+
}, []),
|
|
88
|
+
children: e
|
|
89
|
+
}
|
|
90
|
+
) }),
|
|
91
|
+
V ? /* @__PURE__ */ se(
|
|
92
|
+
Je,
|
|
93
|
+
{
|
|
94
|
+
"aria-hidden": !0,
|
|
95
|
+
required: T,
|
|
96
|
+
tabIndex: -1,
|
|
97
|
+
name: g,
|
|
98
|
+
autoComplete: C,
|
|
99
|
+
value: K,
|
|
100
|
+
onChange: (_) => X(_.target.value),
|
|
101
|
+
disabled: E,
|
|
102
|
+
form: y,
|
|
103
|
+
children: [
|
|
104
|
+
K === void 0 ? /* @__PURE__ */ p("option", { value: "" }) : null,
|
|
105
|
+
Array.from(G)
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
U
|
|
109
|
+
) : null
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
) });
|
|
113
|
+
};
|
|
114
|
+
Ne.displayName = J;
|
|
115
|
+
var Me = "SelectTrigger", Ae = t.forwardRef(
|
|
116
|
+
(o, s) => {
|
|
117
|
+
const { __scopeSelect: e, disabled: i = !1, ...l } = o, d = ue(e), n = j(Me, e), r = n.disabled || i, c = k(s, n.onTriggerChange), f = de(e), g = t.useRef("touch"), [C, E, T] = et((a) => {
|
|
118
|
+
const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === n.value), m = tt(h, a, S);
|
|
119
|
+
m !== void 0 && n.onValueChange(m.value);
|
|
120
|
+
}), y = (a) => {
|
|
121
|
+
r || (n.onOpenChange(!0), T()), a && (n.triggerPointerDownPosRef.current = {
|
|
122
|
+
x: Math.round(a.pageX),
|
|
123
|
+
y: Math.round(a.pageY)
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
return /* @__PURE__ */ p(at, { asChild: !0, ...d, children: /* @__PURE__ */ p(
|
|
127
|
+
M.button,
|
|
128
|
+
{
|
|
129
|
+
type: "button",
|
|
130
|
+
role: "combobox",
|
|
131
|
+
"aria-controls": n.contentId,
|
|
132
|
+
"aria-expanded": n.open,
|
|
133
|
+
"aria-required": n.required,
|
|
134
|
+
"aria-autocomplete": "none",
|
|
135
|
+
dir: n.dir,
|
|
136
|
+
"data-state": n.open ? "open" : "closed",
|
|
137
|
+
disabled: r,
|
|
138
|
+
"data-disabled": r ? "" : void 0,
|
|
139
|
+
"data-placeholder": Qe(n.value) ? "" : void 0,
|
|
140
|
+
...l,
|
|
141
|
+
ref: c,
|
|
142
|
+
onClick: R(l.onClick, (a) => {
|
|
143
|
+
a.currentTarget.focus(), g.current !== "mouse" && y(a);
|
|
144
|
+
}),
|
|
145
|
+
onPointerDown: R(l.onPointerDown, (a) => {
|
|
146
|
+
g.current = a.pointerType;
|
|
147
|
+
const h = a.target;
|
|
148
|
+
h.hasPointerCapture(a.pointerId) && h.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (y(a), a.preventDefault());
|
|
149
|
+
}),
|
|
150
|
+
onKeyDown: R(l.onKeyDown, (a) => {
|
|
151
|
+
const h = C.current !== "";
|
|
152
|
+
!(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && E(a.key), !(h && a.key === " ") && wt.includes(a.key) && (y(), a.preventDefault());
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
) });
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
Ae.displayName = Me;
|
|
159
|
+
var Oe = "SelectValue", De = t.forwardRef(
|
|
160
|
+
(o, s) => {
|
|
161
|
+
const { __scopeSelect: e, className: i, style: l, children: d, placeholder: n = "", ...r } = o, c = j(Oe, e), { onValueNodeHasChildrenChange: f } = c, g = d !== void 0, C = k(s, c.onValueNodeChange);
|
|
162
|
+
return Y(() => {
|
|
163
|
+
f(g);
|
|
164
|
+
}, [f, g]), /* @__PURE__ */ p(
|
|
165
|
+
M.span,
|
|
166
|
+
{
|
|
167
|
+
...r,
|
|
168
|
+
ref: C,
|
|
169
|
+
style: { pointerEvents: "none" },
|
|
170
|
+
children: Qe(c.value) ? /* @__PURE__ */ p(Te, { children: n }) : d
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
De.displayName = Oe;
|
|
176
|
+
var Pt = "SelectIcon", Le = t.forwardRef(
|
|
177
|
+
(o, s) => {
|
|
178
|
+
const { __scopeSelect: e, children: i, ...l } = o;
|
|
179
|
+
return /* @__PURE__ */ p(M.span, { "aria-hidden": !0, ...l, ref: s, children: i || "▼" });
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
Le.displayName = Pt;
|
|
183
|
+
var Rt = "SelectPortal", ke = (o) => /* @__PURE__ */ p(pt, { asChild: !0, ...o });
|
|
184
|
+
ke.displayName = Rt;
|
|
185
|
+
var Q = "SelectContent", Be = t.forwardRef(
|
|
186
|
+
(o, s) => {
|
|
187
|
+
const e = j(Q, o.__scopeSelect), [i, l] = t.useState();
|
|
188
|
+
if (Y(() => {
|
|
189
|
+
l(new DocumentFragment());
|
|
190
|
+
}, []), !e.open) {
|
|
191
|
+
const d = i;
|
|
192
|
+
return d ? be.createPortal(
|
|
193
|
+
/* @__PURE__ */ p(Ve, { scope: o.__scopeSelect, children: /* @__PURE__ */ p(ae.Slot, { scope: o.__scopeSelect, children: /* @__PURE__ */ p("div", { children: o.children }) }) }),
|
|
194
|
+
d
|
|
195
|
+
) : null;
|
|
196
|
+
}
|
|
197
|
+
return /* @__PURE__ */ p(He, { ...o, ref: s });
|
|
198
|
+
}
|
|
199
|
+
);
|
|
200
|
+
Be.displayName = Q;
|
|
201
|
+
var O = 10, [Ve, q] = te(Q), Et = "SelectContentImpl", bt = ft("SelectContent.RemoveScroll"), He = t.forwardRef(
|
|
202
|
+
(o, s) => {
|
|
203
|
+
const {
|
|
204
|
+
__scopeSelect: e,
|
|
205
|
+
position: i = "item-aligned",
|
|
206
|
+
onCloseAutoFocus: l,
|
|
207
|
+
onEscapeKeyDown: d,
|
|
208
|
+
onPointerDownOutside: n,
|
|
209
|
+
//
|
|
210
|
+
// PopperContent props
|
|
211
|
+
side: r,
|
|
212
|
+
sideOffset: c,
|
|
213
|
+
align: f,
|
|
214
|
+
alignOffset: g,
|
|
215
|
+
arrowPadding: C,
|
|
216
|
+
collisionBoundary: E,
|
|
217
|
+
collisionPadding: T,
|
|
218
|
+
sticky: y,
|
|
219
|
+
hideWhenDetached: a,
|
|
220
|
+
avoidCollisions: h,
|
|
221
|
+
//
|
|
222
|
+
...S
|
|
223
|
+
} = o, m = j(Q, e), [v, F] = t.useState(null), [A, oe] = t.useState(null), b = k(s, (u) => F(u)), [D, K] = t.useState(null), [X, B] = t.useState(
|
|
224
|
+
null
|
|
225
|
+
), V = de(e), [G, H] = t.useState(!1), U = t.useRef(!1);
|
|
226
|
+
t.useEffect(() => {
|
|
227
|
+
if (v) return gt(v);
|
|
228
|
+
}, [v]), ct();
|
|
229
|
+
const _ = t.useCallback(
|
|
230
|
+
(u) => {
|
|
231
|
+
const [I, ...N] = V().map((P) => P.ref.current), [w] = N.slice(-1), x = document.activeElement;
|
|
232
|
+
for (const P of u)
|
|
233
|
+
if (P === x || (P?.scrollIntoView({ block: "nearest" }), P === I && A && (A.scrollTop = 0), P === w && A && (A.scrollTop = A.scrollHeight), P?.focus(), document.activeElement !== x)) return;
|
|
234
|
+
},
|
|
235
|
+
[V, A]
|
|
236
|
+
), L = t.useCallback(
|
|
237
|
+
() => _([D, v]),
|
|
238
|
+
[_, D, v]
|
|
239
|
+
);
|
|
240
|
+
t.useEffect(() => {
|
|
241
|
+
G && L();
|
|
242
|
+
}, [G, L]);
|
|
243
|
+
const { onOpenChange: W, triggerPointerDownPosRef: z } = m;
|
|
244
|
+
t.useEffect(() => {
|
|
245
|
+
if (v) {
|
|
246
|
+
let u = { x: 0, y: 0 };
|
|
247
|
+
const I = (w) => {
|
|
248
|
+
u = {
|
|
249
|
+
x: Math.abs(Math.round(w.pageX) - (z.current?.x ?? 0)),
|
|
250
|
+
y: Math.abs(Math.round(w.pageY) - (z.current?.y ?? 0))
|
|
251
|
+
};
|
|
252
|
+
}, N = (w) => {
|
|
253
|
+
u.x <= 10 && u.y <= 10 ? w.preventDefault() : v.contains(w.target) || W(!1), document.removeEventListener("pointermove", I), z.current = null;
|
|
254
|
+
};
|
|
255
|
+
return z.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", N, { capture: !0, once: !0 })), () => {
|
|
256
|
+
document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", N, { capture: !0 });
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
}, [v, W, z]), t.useEffect(() => {
|
|
260
|
+
const u = () => W(!1);
|
|
261
|
+
return window.addEventListener("blur", u), window.addEventListener("resize", u), () => {
|
|
262
|
+
window.removeEventListener("blur", u), window.removeEventListener("resize", u);
|
|
263
|
+
};
|
|
264
|
+
}, [W]);
|
|
265
|
+
const [pe, le] = et((u) => {
|
|
266
|
+
const I = V().filter((x) => !x.disabled), N = I.find((x) => x.ref.current === document.activeElement), w = tt(I, u, N);
|
|
267
|
+
w && setTimeout(() => w.ref.current.focus());
|
|
268
|
+
}), fe = t.useCallback(
|
|
269
|
+
(u, I, N) => {
|
|
270
|
+
const w = !U.current && !N;
|
|
271
|
+
(m.value !== void 0 && m.value === I || w) && (K(u), w && (U.current = !0));
|
|
272
|
+
},
|
|
273
|
+
[m.value]
|
|
274
|
+
), me = t.useCallback(() => v?.focus(), [v]), ee = t.useCallback(
|
|
275
|
+
(u, I, N) => {
|
|
276
|
+
const w = !U.current && !N;
|
|
277
|
+
(m.value !== void 0 && m.value === I || w) && B(u);
|
|
278
|
+
},
|
|
279
|
+
[m.value]
|
|
280
|
+
), ce = i === "popper" ? Se : Ue, ne = ce === Se ? {
|
|
281
|
+
side: r,
|
|
282
|
+
sideOffset: c,
|
|
283
|
+
align: f,
|
|
284
|
+
alignOffset: g,
|
|
285
|
+
arrowPadding: C,
|
|
286
|
+
collisionBoundary: E,
|
|
287
|
+
collisionPadding: T,
|
|
288
|
+
sticky: y,
|
|
289
|
+
hideWhenDetached: a,
|
|
290
|
+
avoidCollisions: h
|
|
291
|
+
} : {};
|
|
292
|
+
return /* @__PURE__ */ p(
|
|
293
|
+
Ve,
|
|
294
|
+
{
|
|
295
|
+
scope: e,
|
|
296
|
+
content: v,
|
|
297
|
+
viewport: A,
|
|
298
|
+
onViewportChange: oe,
|
|
299
|
+
itemRefCallback: fe,
|
|
300
|
+
selectedItem: D,
|
|
301
|
+
onItemLeave: me,
|
|
302
|
+
itemTextRefCallback: ee,
|
|
303
|
+
focusSelectedItem: L,
|
|
304
|
+
selectedItemText: X,
|
|
305
|
+
position: i,
|
|
306
|
+
isPositioned: G,
|
|
307
|
+
searchRef: pe,
|
|
308
|
+
children: /* @__PURE__ */ p(St, { as: bt, allowPinchZoom: !0, children: /* @__PURE__ */ p(
|
|
309
|
+
st,
|
|
310
|
+
{
|
|
311
|
+
asChild: !0,
|
|
312
|
+
trapped: m.open,
|
|
313
|
+
onMountAutoFocus: (u) => {
|
|
314
|
+
u.preventDefault();
|
|
315
|
+
},
|
|
316
|
+
onUnmountAutoFocus: R(l, (u) => {
|
|
317
|
+
m.trigger?.focus({ preventScroll: !0 }), u.preventDefault();
|
|
318
|
+
}),
|
|
319
|
+
children: /* @__PURE__ */ p(
|
|
320
|
+
lt,
|
|
321
|
+
{
|
|
322
|
+
asChild: !0,
|
|
323
|
+
disableOutsidePointerEvents: !0,
|
|
324
|
+
onEscapeKeyDown: d,
|
|
325
|
+
onPointerDownOutside: n,
|
|
326
|
+
onFocusOutside: (u) => u.preventDefault(),
|
|
327
|
+
onDismiss: () => m.onOpenChange(!1),
|
|
328
|
+
children: /* @__PURE__ */ p(
|
|
329
|
+
ce,
|
|
330
|
+
{
|
|
331
|
+
role: "listbox",
|
|
332
|
+
id: m.contentId,
|
|
333
|
+
"data-state": m.open ? "open" : "closed",
|
|
334
|
+
dir: m.dir,
|
|
335
|
+
onContextMenu: (u) => u.preventDefault(),
|
|
336
|
+
...S,
|
|
337
|
+
...ne,
|
|
338
|
+
onPlaced: () => H(!0),
|
|
339
|
+
ref: b,
|
|
340
|
+
style: {
|
|
341
|
+
// flex layout so we can place the scroll buttons properly
|
|
342
|
+
display: "flex",
|
|
343
|
+
flexDirection: "column",
|
|
344
|
+
// reset the outline by default as the content MAY get focused
|
|
345
|
+
outline: "none",
|
|
346
|
+
...S.style
|
|
347
|
+
},
|
|
348
|
+
onKeyDown: R(S.onKeyDown, (u) => {
|
|
349
|
+
const I = u.ctrlKey || u.altKey || u.metaKey;
|
|
350
|
+
if (u.key === "Tab" && u.preventDefault(), !I && u.key.length === 1 && le(u.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(u.key)) {
|
|
351
|
+
let w = V().filter((x) => !x.disabled).map((x) => x.ref.current);
|
|
352
|
+
if (["ArrowUp", "End"].includes(u.key) && (w = w.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
|
|
353
|
+
const x = u.target, P = w.indexOf(x);
|
|
354
|
+
w = w.slice(P + 1);
|
|
355
|
+
}
|
|
356
|
+
setTimeout(() => _(w)), u.preventDefault();
|
|
357
|
+
}
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
}
|
|
364
|
+
) })
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
He.displayName = Et;
|
|
370
|
+
var _t = "SelectItemAlignedPosition", Ue = t.forwardRef((o, s) => {
|
|
371
|
+
const { __scopeSelect: e, onPlaced: i, ...l } = o, d = j(Q, e), n = q(Q, e), [r, c] = t.useState(null), [f, g] = t.useState(null), C = k(s, (b) => g(b)), E = de(e), T = t.useRef(!1), y = t.useRef(!0), { viewport: a, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = n, v = t.useCallback(() => {
|
|
372
|
+
if (d.trigger && d.valueNode && r && f && a && h && S) {
|
|
373
|
+
const b = d.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), K = d.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
|
|
374
|
+
if (d.dir !== "rtl") {
|
|
375
|
+
const x = X.left - D.left, P = K.left - x, Z = b.left - P, $ = b.width + Z, he = Math.max($, D.width), ve = window.innerWidth - O, ge = Re(P, [
|
|
376
|
+
O,
|
|
377
|
+
// Prevents the content from going off the starting edge of the
|
|
378
|
+
// viewport. It may still go off the ending edge, but this can be
|
|
379
|
+
// controlled by the user since they may want to manage overflow in a
|
|
380
|
+
// specific way.
|
|
381
|
+
// https://github.com/radix-ui/primitives/issues/2049
|
|
382
|
+
Math.max(O, ve - he)
|
|
383
|
+
]);
|
|
384
|
+
r.style.minWidth = $ + "px", r.style.left = ge + "px";
|
|
385
|
+
} else {
|
|
386
|
+
const x = D.right - X.right, P = window.innerWidth - K.right - x, Z = window.innerWidth - b.right - P, $ = b.width + Z, he = Math.max($, D.width), ve = window.innerWidth - O, ge = Re(P, [
|
|
387
|
+
O,
|
|
388
|
+
Math.max(O, ve - he)
|
|
389
|
+
]);
|
|
390
|
+
r.style.minWidth = $ + "px", r.style.right = ge + "px";
|
|
391
|
+
}
|
|
392
|
+
const B = E(), V = window.innerHeight - O * 2, G = a.scrollHeight, H = window.getComputedStyle(f), U = parseInt(H.borderTopWidth, 10), _ = parseInt(H.paddingTop, 10), L = parseInt(H.borderBottomWidth, 10), W = parseInt(H.paddingBottom, 10), z = U + _ + G + W + L, pe = Math.min(h.offsetHeight * 5, z), le = window.getComputedStyle(a), fe = parseInt(le.paddingTop, 10), me = parseInt(le.paddingBottom, 10), ee = b.top + b.height / 2 - O, ce = V - ee, ne = h.offsetHeight / 2, u = h.offsetTop + ne, I = U + _ + u, N = z - I;
|
|
393
|
+
if (I <= ee) {
|
|
394
|
+
const x = B.length > 0 && h === B[B.length - 1].ref.current;
|
|
395
|
+
r.style.bottom = "0px";
|
|
396
|
+
const P = f.clientHeight - a.offsetTop - a.offsetHeight, Z = Math.max(
|
|
397
|
+
ce,
|
|
398
|
+
ne + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
399
|
+
(x ? me : 0) + P + L
|
|
400
|
+
), $ = I + Z;
|
|
401
|
+
r.style.height = $ + "px";
|
|
402
|
+
} else {
|
|
403
|
+
const x = B.length > 0 && h === B[0].ref.current;
|
|
404
|
+
r.style.top = "0px";
|
|
405
|
+
const Z = Math.max(
|
|
406
|
+
ee,
|
|
407
|
+
U + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
408
|
+
(x ? fe : 0) + ne
|
|
409
|
+
) + N;
|
|
410
|
+
r.style.height = Z + "px", a.scrollTop = I - ee + a.offsetTop;
|
|
411
|
+
}
|
|
412
|
+
r.style.margin = `${O}px 0`, r.style.minHeight = pe + "px", r.style.maxHeight = V + "px", i?.(), requestAnimationFrame(() => T.current = !0);
|
|
413
|
+
}
|
|
414
|
+
}, [
|
|
415
|
+
E,
|
|
416
|
+
d.trigger,
|
|
417
|
+
d.valueNode,
|
|
418
|
+
r,
|
|
419
|
+
f,
|
|
420
|
+
a,
|
|
421
|
+
h,
|
|
422
|
+
S,
|
|
423
|
+
d.dir,
|
|
424
|
+
i
|
|
425
|
+
]);
|
|
426
|
+
Y(() => v(), [v]);
|
|
427
|
+
const [F, A] = t.useState();
|
|
428
|
+
Y(() => {
|
|
429
|
+
f && A(window.getComputedStyle(f).zIndex);
|
|
430
|
+
}, [f]);
|
|
431
|
+
const oe = t.useCallback(
|
|
432
|
+
(b) => {
|
|
433
|
+
b && y.current === !0 && (v(), m?.(), y.current = !1);
|
|
434
|
+
},
|
|
435
|
+
[v, m]
|
|
436
|
+
);
|
|
437
|
+
return /* @__PURE__ */ p(
|
|
438
|
+
Mt,
|
|
439
|
+
{
|
|
440
|
+
scope: e,
|
|
441
|
+
contentWrapper: r,
|
|
442
|
+
shouldExpandOnScrollRef: T,
|
|
443
|
+
onScrollButtonChange: oe,
|
|
444
|
+
children: /* @__PURE__ */ p(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
ref: c,
|
|
448
|
+
style: {
|
|
449
|
+
display: "flex",
|
|
450
|
+
flexDirection: "column",
|
|
451
|
+
position: "fixed",
|
|
452
|
+
zIndex: F
|
|
453
|
+
},
|
|
454
|
+
children: /* @__PURE__ */ p(
|
|
455
|
+
M.div,
|
|
456
|
+
{
|
|
457
|
+
...l,
|
|
458
|
+
ref: C,
|
|
459
|
+
style: {
|
|
460
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
461
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
462
|
+
boxSizing: "border-box",
|
|
463
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
464
|
+
maxHeight: "100%",
|
|
465
|
+
...l.style
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
});
|
|
474
|
+
Ue.displayName = _t;
|
|
475
|
+
var Nt = "SelectPopperPosition", Se = t.forwardRef((o, s) => {
|
|
476
|
+
const {
|
|
477
|
+
__scopeSelect: e,
|
|
478
|
+
align: i = "start",
|
|
479
|
+
collisionPadding: l = O,
|
|
480
|
+
...d
|
|
481
|
+
} = o, n = ue(e);
|
|
482
|
+
return /* @__PURE__ */ p(
|
|
483
|
+
dt,
|
|
484
|
+
{
|
|
485
|
+
...n,
|
|
486
|
+
...d,
|
|
487
|
+
ref: s,
|
|
488
|
+
align: i,
|
|
489
|
+
collisionPadding: l,
|
|
490
|
+
style: {
|
|
491
|
+
// Ensure border-box for floating-ui calculations
|
|
492
|
+
boxSizing: "border-box",
|
|
493
|
+
...d.style,
|
|
494
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
495
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
496
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
497
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
498
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
});
|
|
503
|
+
Se.displayName = Nt;
|
|
504
|
+
var [Mt, Pe] = te(Q, {}), we = "SelectViewport", We = t.forwardRef(
|
|
505
|
+
(o, s) => {
|
|
506
|
+
const { __scopeSelect: e, nonce: i, ...l } = o, d = q(we, e), n = Pe(we, e), r = k(s, d.onViewportChange), c = t.useRef(0);
|
|
507
|
+
return /* @__PURE__ */ se(Te, { children: [
|
|
508
|
+
/* @__PURE__ */ p(
|
|
509
|
+
"style",
|
|
510
|
+
{
|
|
511
|
+
dangerouslySetInnerHTML: {
|
|
512
|
+
__html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
|
|
513
|
+
},
|
|
514
|
+
nonce: i
|
|
515
|
+
}
|
|
516
|
+
),
|
|
517
|
+
/* @__PURE__ */ p(ae.Slot, { scope: e, children: /* @__PURE__ */ p(
|
|
518
|
+
M.div,
|
|
519
|
+
{
|
|
520
|
+
"data-radix-select-viewport": "",
|
|
521
|
+
role: "presentation",
|
|
522
|
+
...l,
|
|
523
|
+
ref: r,
|
|
524
|
+
style: {
|
|
525
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
526
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
527
|
+
// (independent of the scrollUpButton).
|
|
528
|
+
position: "relative",
|
|
529
|
+
flex: 1,
|
|
530
|
+
// Viewport should only be scrollable in the vertical direction.
|
|
531
|
+
// This won't work in vertical writing modes, so we'll need to
|
|
532
|
+
// revisit this if/when that is supported
|
|
533
|
+
// https://developer.chrome.com/blog/vertical-form-controls
|
|
534
|
+
overflow: "hidden auto",
|
|
535
|
+
...l.style
|
|
536
|
+
},
|
|
537
|
+
onScroll: R(l.onScroll, (f) => {
|
|
538
|
+
const g = f.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: E } = n;
|
|
539
|
+
if (E?.current && C) {
|
|
540
|
+
const T = Math.abs(c.current - g.scrollTop);
|
|
541
|
+
if (T > 0) {
|
|
542
|
+
const y = window.innerHeight - O * 2, a = parseFloat(C.style.minHeight), h = parseFloat(C.style.height), S = Math.max(a, h);
|
|
543
|
+
if (S < y) {
|
|
544
|
+
const m = S + T, v = Math.min(y, m), F = m - v;
|
|
545
|
+
C.style.height = v + "px", C.style.bottom === "0px" && (g.scrollTop = F > 0 ? F : 0, C.style.justifyContent = "flex-end");
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
c.current = g.scrollTop;
|
|
550
|
+
})
|
|
551
|
+
}
|
|
552
|
+
) })
|
|
553
|
+
] });
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
We.displayName = we;
|
|
557
|
+
var Fe = "SelectGroup", [At, Ot] = te(Fe), Dt = t.forwardRef(
|
|
558
|
+
(o, s) => {
|
|
559
|
+
const { __scopeSelect: e, ...i } = o, l = Ie();
|
|
560
|
+
return /* @__PURE__ */ p(At, { scope: e, id: l, children: /* @__PURE__ */ p(M.div, { role: "group", "aria-labelledby": l, ...i, ref: s }) });
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
Dt.displayName = Fe;
|
|
564
|
+
var Ke = "SelectLabel", Lt = t.forwardRef(
|
|
565
|
+
(o, s) => {
|
|
566
|
+
const { __scopeSelect: e, ...i } = o, l = Ot(Ke, e);
|
|
567
|
+
return /* @__PURE__ */ p(M.div, { id: l.id, ...i, ref: s });
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
Lt.displayName = Ke;
|
|
571
|
+
var ie = "SelectItem", [kt, Ge] = te(ie), ze = t.forwardRef(
|
|
572
|
+
(o, s) => {
|
|
573
|
+
const {
|
|
574
|
+
__scopeSelect: e,
|
|
575
|
+
value: i,
|
|
576
|
+
disabled: l = !1,
|
|
577
|
+
textValue: d,
|
|
578
|
+
...n
|
|
579
|
+
} = o, r = j(ie, e), c = q(ie, e), f = r.value === i, [g, C] = t.useState(d ?? ""), [E, T] = t.useState(!1), y = k(
|
|
580
|
+
s,
|
|
581
|
+
(m) => c.itemRefCallback?.(m, i, l)
|
|
582
|
+
), a = Ie(), h = t.useRef("touch"), S = () => {
|
|
583
|
+
l || (r.onValueChange(i), r.onOpenChange(!1));
|
|
584
|
+
};
|
|
585
|
+
if (i === "")
|
|
586
|
+
throw new Error(
|
|
587
|
+
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
588
|
+
);
|
|
589
|
+
return /* @__PURE__ */ p(
|
|
590
|
+
kt,
|
|
591
|
+
{
|
|
592
|
+
scope: e,
|
|
593
|
+
value: i,
|
|
594
|
+
disabled: l,
|
|
595
|
+
textId: a,
|
|
596
|
+
isSelected: f,
|
|
597
|
+
onItemTextChange: t.useCallback((m) => {
|
|
598
|
+
C((v) => v || (m?.textContent ?? "").trim());
|
|
599
|
+
}, []),
|
|
600
|
+
children: /* @__PURE__ */ p(
|
|
601
|
+
ae.ItemSlot,
|
|
602
|
+
{
|
|
603
|
+
scope: e,
|
|
604
|
+
value: i,
|
|
605
|
+
disabled: l,
|
|
606
|
+
textValue: g,
|
|
607
|
+
children: /* @__PURE__ */ p(
|
|
608
|
+
M.div,
|
|
609
|
+
{
|
|
610
|
+
role: "option",
|
|
611
|
+
"aria-labelledby": a,
|
|
612
|
+
"data-highlighted": E ? "" : void 0,
|
|
613
|
+
"aria-selected": f && E,
|
|
614
|
+
"data-state": f ? "checked" : "unchecked",
|
|
615
|
+
"aria-disabled": l || void 0,
|
|
616
|
+
"data-disabled": l ? "" : void 0,
|
|
617
|
+
tabIndex: l ? void 0 : -1,
|
|
618
|
+
...n,
|
|
619
|
+
ref: y,
|
|
620
|
+
onFocus: R(n.onFocus, () => T(!0)),
|
|
621
|
+
onBlur: R(n.onBlur, () => T(!1)),
|
|
622
|
+
onClick: R(n.onClick, () => {
|
|
623
|
+
h.current !== "mouse" && S();
|
|
624
|
+
}),
|
|
625
|
+
onPointerUp: R(n.onPointerUp, () => {
|
|
626
|
+
h.current === "mouse" && S();
|
|
627
|
+
}),
|
|
628
|
+
onPointerDown: R(n.onPointerDown, (m) => {
|
|
629
|
+
h.current = m.pointerType;
|
|
630
|
+
}),
|
|
631
|
+
onPointerMove: R(n.onPointerMove, (m) => {
|
|
632
|
+
h.current = m.pointerType, l ? c.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
|
|
633
|
+
}),
|
|
634
|
+
onPointerLeave: R(n.onPointerLeave, (m) => {
|
|
635
|
+
m.currentTarget === document.activeElement && c.onItemLeave?.();
|
|
636
|
+
}),
|
|
637
|
+
onKeyDown: R(n.onKeyDown, (m) => {
|
|
638
|
+
c.searchRef?.current !== "" && m.key === " " || (Ct.includes(m.key) && S(), m.key === " " && m.preventDefault());
|
|
639
|
+
})
|
|
640
|
+
}
|
|
641
|
+
)
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
);
|
|
648
|
+
ze.displayName = ie;
|
|
649
|
+
var re = "SelectItemText", Ye = t.forwardRef(
|
|
650
|
+
(o, s) => {
|
|
651
|
+
const { __scopeSelect: e, className: i, style: l, ...d } = o, n = j(re, e), r = q(re, e), c = Ge(re, e), f = Tt(re, e), [g, C] = t.useState(null), E = k(
|
|
652
|
+
s,
|
|
653
|
+
(S) => C(S),
|
|
654
|
+
c.onItemTextChange,
|
|
655
|
+
(S) => r.itemTextRefCallback?.(S, c.value, c.disabled)
|
|
656
|
+
), T = g?.textContent, y = t.useMemo(
|
|
657
|
+
() => /* @__PURE__ */ p("option", { value: c.value, disabled: c.disabled, children: T }, c.value),
|
|
658
|
+
[c.disabled, c.value, T]
|
|
659
|
+
), { onNativeOptionAdd: a, onNativeOptionRemove: h } = f;
|
|
660
|
+
return Y(() => (a(y), () => h(y)), [a, h, y]), /* @__PURE__ */ se(Te, { children: [
|
|
661
|
+
/* @__PURE__ */ p(M.span, { id: c.textId, ...d, ref: E }),
|
|
662
|
+
c.isSelected && n.valueNode && !n.valueNodeHasChildren ? be.createPortal(d.children, n.valueNode) : null
|
|
663
|
+
] });
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
Ye.displayName = re;
|
|
667
|
+
var je = "SelectItemIndicator", qe = t.forwardRef(
|
|
668
|
+
(o, s) => {
|
|
669
|
+
const { __scopeSelect: e, ...i } = o;
|
|
670
|
+
return Ge(je, e).isSelected ? /* @__PURE__ */ p(M.span, { "aria-hidden": !0, ...i, ref: s }) : null;
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
qe.displayName = je;
|
|
674
|
+
var Ce = "SelectScrollUpButton", Xe = t.forwardRef((o, s) => {
|
|
675
|
+
const e = q(Ce, o.__scopeSelect), i = Pe(Ce, o.__scopeSelect), [l, d] = t.useState(!1), n = k(s, i.onScrollButtonChange);
|
|
676
|
+
return Y(() => {
|
|
677
|
+
if (e.viewport && e.isPositioned) {
|
|
678
|
+
let r = function() {
|
|
679
|
+
const f = c.scrollTop > 0;
|
|
680
|
+
d(f);
|
|
681
|
+
};
|
|
682
|
+
const c = e.viewport;
|
|
683
|
+
return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
|
|
684
|
+
}
|
|
685
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ p(
|
|
686
|
+
$e,
|
|
687
|
+
{
|
|
688
|
+
...o,
|
|
689
|
+
ref: n,
|
|
690
|
+
onAutoScroll: () => {
|
|
691
|
+
const { viewport: r, selectedItem: c } = e;
|
|
692
|
+
r && c && (r.scrollTop = r.scrollTop - c.offsetHeight);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
) : null;
|
|
696
|
+
});
|
|
697
|
+
Xe.displayName = Ce;
|
|
698
|
+
var xe = "SelectScrollDownButton", Ze = t.forwardRef((o, s) => {
|
|
699
|
+
const e = q(xe, o.__scopeSelect), i = Pe(xe, o.__scopeSelect), [l, d] = t.useState(!1), n = k(s, i.onScrollButtonChange);
|
|
700
|
+
return Y(() => {
|
|
701
|
+
if (e.viewport && e.isPositioned) {
|
|
702
|
+
let r = function() {
|
|
703
|
+
const f = c.scrollHeight - c.clientHeight, g = Math.ceil(c.scrollTop) < f;
|
|
704
|
+
d(g);
|
|
705
|
+
};
|
|
706
|
+
const c = e.viewport;
|
|
707
|
+
return r(), c.addEventListener("scroll", r), () => c.removeEventListener("scroll", r);
|
|
708
|
+
}
|
|
709
|
+
}, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ p(
|
|
710
|
+
$e,
|
|
711
|
+
{
|
|
712
|
+
...o,
|
|
713
|
+
ref: n,
|
|
714
|
+
onAutoScroll: () => {
|
|
715
|
+
const { viewport: r, selectedItem: c } = e;
|
|
716
|
+
r && c && (r.scrollTop = r.scrollTop + c.offsetHeight);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
) : null;
|
|
720
|
+
});
|
|
721
|
+
Ze.displayName = xe;
|
|
722
|
+
var $e = t.forwardRef((o, s) => {
|
|
723
|
+
const { __scopeSelect: e, onAutoScroll: i, ...l } = o, d = q("SelectScrollButton", e), n = t.useRef(null), r = de(e), c = t.useCallback(() => {
|
|
724
|
+
n.current !== null && (window.clearInterval(n.current), n.current = null);
|
|
725
|
+
}, []);
|
|
726
|
+
return t.useEffect(() => () => c(), [c]), Y(() => {
|
|
727
|
+
r().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
728
|
+
}, [r]), /* @__PURE__ */ p(
|
|
729
|
+
M.div,
|
|
730
|
+
{
|
|
731
|
+
"aria-hidden": !0,
|
|
732
|
+
...l,
|
|
733
|
+
ref: s,
|
|
734
|
+
style: { flexShrink: 0, ...l.style },
|
|
735
|
+
onPointerDown: R(l.onPointerDown, () => {
|
|
736
|
+
n.current === null && (n.current = window.setInterval(i, 50));
|
|
737
|
+
}),
|
|
738
|
+
onPointerMove: R(l.onPointerMove, () => {
|
|
739
|
+
d.onItemLeave?.(), n.current === null && (n.current = window.setInterval(i, 50));
|
|
740
|
+
}),
|
|
741
|
+
onPointerLeave: R(l.onPointerLeave, () => {
|
|
742
|
+
c();
|
|
743
|
+
})
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
}), Bt = "SelectSeparator", Vt = t.forwardRef(
|
|
747
|
+
(o, s) => {
|
|
748
|
+
const { __scopeSelect: e, ...i } = o;
|
|
749
|
+
return /* @__PURE__ */ p(M.div, { "aria-hidden": !0, ...i, ref: s });
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
Vt.displayName = Bt;
|
|
753
|
+
var ye = "SelectArrow", Ht = t.forwardRef(
|
|
754
|
+
(o, s) => {
|
|
755
|
+
const { __scopeSelect: e, ...i } = o, l = ue(e), d = j(ye, e), n = q(ye, e);
|
|
756
|
+
return d.open && n.position === "popper" ? /* @__PURE__ */ p(ut, { ...l, ...i, ref: s }) : null;
|
|
757
|
+
}
|
|
758
|
+
);
|
|
759
|
+
Ht.displayName = ye;
|
|
760
|
+
var Ut = "SelectBubbleInput", Je = t.forwardRef(
|
|
761
|
+
({ __scopeSelect: o, value: s, ...e }, i) => {
|
|
762
|
+
const l = t.useRef(null), d = k(i, l), n = ht(s);
|
|
763
|
+
return t.useEffect(() => {
|
|
764
|
+
const r = l.current;
|
|
765
|
+
if (!r) return;
|
|
766
|
+
const c = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
|
|
767
|
+
c,
|
|
768
|
+
"value"
|
|
769
|
+
).set;
|
|
770
|
+
if (n !== s && g) {
|
|
771
|
+
const C = new Event("change", { bubbles: !0 });
|
|
772
|
+
g.call(r, s), r.dispatchEvent(C);
|
|
773
|
+
}
|
|
774
|
+
}, [n, s]), /* @__PURE__ */ p(
|
|
775
|
+
M.select,
|
|
776
|
+
{
|
|
777
|
+
...e,
|
|
778
|
+
style: { ...vt, ...e.style },
|
|
779
|
+
ref: d,
|
|
780
|
+
defaultValue: s
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
);
|
|
785
|
+
Je.displayName = Ut;
|
|
786
|
+
function Qe(o) {
|
|
787
|
+
return o === "" || o === void 0;
|
|
788
|
+
}
|
|
789
|
+
function et(o) {
|
|
790
|
+
const s = mt(o), e = t.useRef(""), i = t.useRef(0), l = t.useCallback(
|
|
791
|
+
(n) => {
|
|
792
|
+
const r = e.current + n;
|
|
793
|
+
s(r), (function c(f) {
|
|
794
|
+
e.current = f, window.clearTimeout(i.current), f !== "" && (i.current = window.setTimeout(() => c(""), 1e3));
|
|
795
|
+
})(r);
|
|
796
|
+
},
|
|
797
|
+
[s]
|
|
798
|
+
), d = t.useCallback(() => {
|
|
799
|
+
e.current = "", window.clearTimeout(i.current);
|
|
800
|
+
}, []);
|
|
801
|
+
return t.useEffect(() => () => window.clearTimeout(i.current), []), [e, l, d];
|
|
802
|
+
}
|
|
803
|
+
function tt(o, s, e) {
|
|
804
|
+
const l = s.length > 1 && Array.from(s).every((f) => f === s[0]) ? s[0] : s, d = e ? o.indexOf(e) : -1;
|
|
805
|
+
let n = Wt(o, Math.max(d, 0));
|
|
806
|
+
l.length === 1 && (n = n.filter((f) => f !== e));
|
|
807
|
+
const c = n.find(
|
|
808
|
+
(f) => f.textValue.toLowerCase().startsWith(l.toLowerCase())
|
|
809
|
+
);
|
|
810
|
+
return c !== e ? c : void 0;
|
|
811
|
+
}
|
|
812
|
+
function Wt(o, s) {
|
|
813
|
+
return o.map((e, i) => o[(s + i) % o.length]);
|
|
814
|
+
}
|
|
815
|
+
var uo = Ne, po = Ae, fo = De, mo = Le, ho = ke, vo = Be, go = We, So = ze, wo = Ye, Co = qe, xo = Xe, yo = Ze;
|
|
816
|
+
export {
|
|
817
|
+
vo as Content,
|
|
818
|
+
mo as Icon,
|
|
819
|
+
So as Item,
|
|
820
|
+
Co as ItemIndicator,
|
|
821
|
+
wo as ItemText,
|
|
822
|
+
ho as Portal,
|
|
823
|
+
uo as Root,
|
|
824
|
+
yo as ScrollDownButton,
|
|
825
|
+
xo as ScrollUpButton,
|
|
826
|
+
Ne as Select,
|
|
827
|
+
Ht as SelectArrow,
|
|
828
|
+
Be as SelectContent,
|
|
829
|
+
Dt as SelectGroup,
|
|
830
|
+
Le as SelectIcon,
|
|
831
|
+
ze as SelectItem,
|
|
832
|
+
qe as SelectItemIndicator,
|
|
833
|
+
Ye as SelectItemText,
|
|
834
|
+
Lt as SelectLabel,
|
|
835
|
+
ke as SelectPortal,
|
|
836
|
+
Ze as SelectScrollDownButton,
|
|
837
|
+
Xe as SelectScrollUpButton,
|
|
838
|
+
Vt as SelectSeparator,
|
|
839
|
+
Ae as SelectTrigger,
|
|
840
|
+
De as SelectValue,
|
|
841
|
+
We as SelectViewport,
|
|
842
|
+
po as Trigger,
|
|
843
|
+
fo as Value,
|
|
844
|
+
go as Viewport
|
|
845
|
+
};
|