@vector-im/compound-web 8.4.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.cjs +33 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/ActivityMarker/Pill.cjs +15 -10
- package/dist/components/ActivityMarker/Pill.cjs.map +1 -1
- package/dist/components/ActivityMarker/Pill.js +13 -10
- package/dist/components/ActivityMarker/Pill.js.map +1 -1
- package/dist/components/ActivityMarker/Pill.module.cjs +5 -0
- package/dist/components/ActivityMarker/Pill.module.cjs.map +1 -0
- package/dist/components/ActivityMarker/Pill.module.js +5 -0
- package/dist/components/ActivityMarker/Pill.module.js.map +1 -0
- package/dist/components/ActivityMarker/Unread.cjs +14 -6
- package/dist/components/ActivityMarker/Unread.cjs.map +1 -1
- package/dist/components/ActivityMarker/Unread.js +12 -6
- package/dist/components/ActivityMarker/Unread.js.map +1 -1
- package/dist/components/ActivityMarker/Unread.module.cjs +5 -0
- package/dist/components/ActivityMarker/Unread.module.cjs.map +1 -0
- package/dist/components/ActivityMarker/Unread.module.js +5 -0
- package/dist/components/ActivityMarker/Unread.module.js.map +1 -0
- package/dist/components/ActivityMarker/UnreadCounter.cjs +18 -8
- package/dist/components/ActivityMarker/UnreadCounter.cjs.map +1 -1
- package/dist/components/ActivityMarker/UnreadCounter.js +16 -8
- package/dist/components/ActivityMarker/UnreadCounter.js.map +1 -1
- package/dist/components/ActivityMarker/UnreadCounter.module.cjs +6 -0
- package/dist/components/ActivityMarker/UnreadCounter.module.cjs.map +1 -0
- package/dist/components/ActivityMarker/UnreadCounter.module.js +6 -0
- package/dist/components/ActivityMarker/UnreadCounter.module.js.map +1 -0
- package/dist/components/Alert/Alert.cjs +72 -61
- package/dist/components/Alert/Alert.cjs.map +1 -1
- package/dist/components/Alert/Alert.js +60 -56
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/Alert/Alert.module.cjs +18 -0
- package/dist/components/Alert/Alert.module.cjs.map +1 -0
- package/dist/components/Alert/Alert.module.js +18 -0
- package/dist/components/Alert/Alert.module.js.map +1 -0
- package/dist/components/Avatar/Avatar.cjs +48 -55
- package/dist/components/Avatar/Avatar.cjs.map +1 -1
- package/dist/components/Avatar/Avatar.js +44 -54
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/Avatar.module.cjs +11 -0
- package/dist/components/Avatar/Avatar.module.cjs.map +1 -0
- package/dist/components/Avatar/Avatar.module.js +11 -0
- package/dist/components/Avatar/Avatar.module.js.map +1 -0
- package/dist/components/Avatar/AvatarStack.cjs +50 -27
- package/dist/components/Avatar/AvatarStack.cjs.map +1 -1
- package/dist/components/Avatar/AvatarStack.js +46 -26
- package/dist/components/Avatar/AvatarStack.js.map +1 -1
- package/dist/components/Avatar/avatar-clip.mask.cjs +6 -0
- package/dist/components/Avatar/avatar-clip.mask.cjs.map +1 -0
- package/dist/components/Avatar/avatar-clip.mask.js +6 -0
- package/dist/components/Avatar/avatar-clip.mask.js.map +1 -0
- package/dist/components/Avatar/useIdColorHash.cjs +13 -9
- package/dist/components/Avatar/useIdColorHash.cjs.map +1 -1
- package/dist/components/Avatar/useIdColorHash.js +14 -10
- package/dist/components/Avatar/useIdColorHash.js.map +1 -1
- package/dist/components/Badge/Badge.cjs +24 -24
- package/dist/components/Badge/Badge.cjs.map +1 -1
- package/dist/components/Badge/Badge.js +21 -24
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/Badge.module.cjs +5 -0
- package/dist/components/Badge/Badge.module.cjs.map +1 -0
- package/dist/components/Badge/Badge.module.js +5 -0
- package/dist/components/Badge/Badge.module.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +56 -54
- package/dist/components/Breadcrumb/Breadcrumb.cjs.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +51 -53
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.module.cjs +9 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.cjs.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.js +9 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.js.map +1 -0
- package/dist/components/Button/Button.cjs +40 -52
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +36 -51
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.module.cjs +13 -0
- package/dist/components/Button/Button.module.cjs.map +1 -0
- package/dist/components/Button/Button.module.js +13 -0
- package/dist/components/Button/Button.module.js.map +1 -0
- package/dist/components/Button/IconButton/IconButton.cjs +43 -52
- package/dist/components/Button/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/Button/IconButton/IconButton.js +38 -50
- package/dist/components/Button/IconButton/IconButton.js.map +1 -1
- package/dist/components/Button/IconButton/IconButton.module.cjs +11 -0
- package/dist/components/Button/IconButton/IconButton.module.cjs.map +1 -0
- package/dist/components/Button/IconButton/IconButton.module.js +11 -0
- package/dist/components/Button/IconButton/IconButton.module.js.map +1 -0
- package/dist/components/Button/UnstyledButton.cjs +36 -45
- package/dist/components/Button/UnstyledButton.cjs.map +1 -1
- package/dist/components/Button/UnstyledButton.js +34 -45
- package/dist/components/Button/UnstyledButton.js.map +1 -1
- package/dist/components/ChatFilter/ChatFilter.cjs +23 -20
- package/dist/components/ChatFilter/ChatFilter.cjs.map +1 -1
- package/dist/components/ChatFilter/ChatFilter.js +21 -20
- package/dist/components/ChatFilter/ChatFilter.js.map +1 -1
- package/dist/components/ChatFilter/ChatFilter.module.cjs +6 -0
- package/dist/components/ChatFilter/ChatFilter.module.cjs.map +1 -0
- package/dist/components/ChatFilter/ChatFilter.module.js +6 -0
- package/dist/components/ChatFilter/ChatFilter.module.js.map +1 -0
- package/dist/components/Dropdown/Dropdown.cjs +231 -249
- package/dist/components/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +225 -249
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.module.cjs +13 -0
- package/dist/components/Dropdown/Dropdown.module.cjs.map +1 -0
- package/dist/components/Dropdown/Dropdown.module.js +13 -0
- package/dist/components/Dropdown/Dropdown.module.js.map +1 -0
- package/dist/components/Form/Controls/Action/Action.cjs +51 -31
- package/dist/components/Form/Controls/Action/Action.cjs.map +1 -1
- package/dist/components/Form/Controls/Action/Action.js +46 -30
- package/dist/components/Form/Controls/Action/Action.js.map +1 -1
- package/dist/components/Form/Controls/Action/Action.module.cjs +9 -0
- package/dist/components/Form/Controls/Action/Action.module.cjs.map +1 -0
- package/dist/components/Form/Controls/Action/Action.module.js +9 -0
- package/dist/components/Form/Controls/Action/Action.module.js.map +1 -0
- package/dist/components/Form/Controls/Checkbox/Checkbox.cjs +42 -20
- package/dist/components/Form/Controls/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Form/Controls/Checkbox/Checkbox.js +36 -19
- package/dist/components/Form/Controls/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.cjs +9 -0
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.cjs.map +1 -0
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.js +9 -0
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.js.map +1 -0
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.cjs +171 -203
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.cjs.map +1 -1
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.js +166 -202
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.js.map +1 -1
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.cjs +8 -0
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.cjs.map +1 -0
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.js +8 -0
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.js.map +1 -0
- package/dist/components/Form/Controls/MFA/MFA.cjs +60 -65
- package/dist/components/Form/Controls/MFA/MFA.cjs.map +1 -1
- package/dist/components/Form/Controls/MFA/MFA.js +56 -65
- package/dist/components/Form/Controls/MFA/MFA.js.map +1 -1
- package/dist/components/Form/Controls/MFA/MFA.module.cjs +9 -0
- package/dist/components/Form/Controls/MFA/MFA.module.cjs.map +1 -0
- package/dist/components/Form/Controls/MFA/MFA.module.js +9 -0
- package/dist/components/Form/Controls/MFA/MFA.module.js.map +1 -0
- package/dist/components/Form/Controls/Password/Password.cjs +52 -37
- package/dist/components/Form/Controls/Password/Password.cjs.map +1 -1
- package/dist/components/Form/Controls/Password/Password.js +45 -35
- package/dist/components/Form/Controls/Password/Password.js.map +1 -1
- package/dist/components/Form/Controls/Radio/Radio.cjs +33 -16
- package/dist/components/Form/Controls/Radio/Radio.cjs.map +1 -1
- package/dist/components/Form/Controls/Radio/Radio.js +28 -15
- package/dist/components/Form/Controls/Radio/Radio.js.map +1 -1
- package/dist/components/Form/Controls/Radio/Radio.module.cjs +9 -0
- package/dist/components/Form/Controls/Radio/Radio.module.cjs.map +1 -0
- package/dist/components/Form/Controls/Radio/Radio.module.js +9 -0
- package/dist/components/Form/Controls/Radio/Radio.module.js.map +1 -0
- package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.cjs +47 -29
- package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.cjs.map +1 -1
- package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.js +43 -28
- package/dist/components/Form/Controls/SettingsToggle/SettingsToggle.js.map +1 -1
- package/dist/components/Form/Controls/Text/Text.cjs +34 -18
- package/dist/components/Form/Controls/Text/Text.cjs.map +1 -1
- package/dist/components/Form/Controls/Text/Text.js +30 -18
- package/dist/components/Form/Controls/Text/Text.js.map +1 -1
- package/dist/components/Form/Controls/Text/Text.module.cjs +8 -0
- package/dist/components/Form/Controls/Text/Text.module.cjs.map +1 -0
- package/dist/components/Form/Controls/Text/Text.module.js +8 -0
- package/dist/components/Form/Controls/Text/Text.module.js.map +1 -0
- package/dist/components/Form/Controls/Toggle/Toggle.cjs +37 -25
- package/dist/components/Form/Controls/Toggle/Toggle.cjs.map +1 -1
- package/dist/components/Form/Controls/Toggle/Toggle.js +32 -24
- package/dist/components/Form/Controls/Toggle/Toggle.js.map +1 -1
- package/dist/components/Form/Controls/Toggle/Toggle.module.cjs +9 -0
- package/dist/components/Form/Controls/Toggle/Toggle.module.cjs.map +1 -0
- package/dist/components/Form/Controls/Toggle/Toggle.module.js +9 -0
- package/dist/components/Form/Controls/Toggle/Toggle.module.js.map +1 -0
- package/dist/components/Form/Field.cjs +25 -14
- package/dist/components/Form/Field.cjs.map +1 -1
- package/dist/components/Form/Field.js +22 -14
- package/dist/components/Form/Field.js.map +1 -1
- package/dist/components/Form/InlineField.cjs +27 -17
- package/dist/components/Form/InlineField.cjs.map +1 -1
- package/dist/components/Form/InlineField.js +23 -16
- package/dist/components/Form/InlineField.js.map +1 -1
- package/dist/components/Form/Label.cjs +24 -11
- package/dist/components/Form/Label.cjs.map +1 -1
- package/dist/components/Form/Label.js +21 -11
- package/dist/components/Form/Label.js.map +1 -1
- package/dist/components/Form/Message.cjs +61 -40
- package/dist/components/Form/Message.cjs.map +1 -1
- package/dist/components/Form/Message.js +54 -41
- package/dist/components/Form/Message.js.map +1 -1
- package/dist/components/Form/Root.cjs +25 -14
- package/dist/components/Form/Root.cjs.map +1 -1
- package/dist/components/Form/Root.js +22 -14
- package/dist/components/Form/Root.js.map +1 -1
- package/dist/components/Form/Submit.cjs +23 -12
- package/dist/components/Form/Submit.cjs.map +1 -1
- package/dist/components/Form/Submit.js +21 -12
- package/dist/components/Form/Submit.js.map +1 -1
- package/dist/components/Form/form.module.cjs +21 -0
- package/dist/components/Form/form.module.cjs.map +1 -0
- package/dist/components/Form/form.module.js +21 -0
- package/dist/components/Form/form.module.js.map +1 -0
- package/dist/components/Form/index.cjs +55 -51
- package/dist/components/Form/index.cjs.map +1 -1
- package/dist/components/Form/index.js +48 -43
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Glass/Glass.cjs +20 -10
- package/dist/components/Glass/Glass.cjs.map +1 -1
- package/dist/components/Glass/Glass.js +17 -10
- package/dist/components/Glass/Glass.js.map +1 -1
- package/dist/components/Glass/Glass.module.cjs +5 -0
- package/dist/components/Glass/Glass.module.cjs.map +1 -0
- package/dist/components/Glass/Glass.module.js +5 -0
- package/dist/components/Glass/Glass.module.js.map +1 -0
- package/dist/components/Icon/BigIcon/BigIcon.cjs +18 -25
- package/dist/components/Icon/BigIcon/BigIcon.cjs.map +1 -1
- package/dist/components/Icon/BigIcon/BigIcon.d.ts +8 -12
- package/dist/components/Icon/BigIcon/BigIcon.d.ts.map +1 -1
- package/dist/components/Icon/BigIcon/BigIcon.js +15 -25
- package/dist/components/Icon/BigIcon/BigIcon.js.map +1 -1
- package/dist/components/Icon/BigIcon/BigIcon.module.cjs +6 -0
- package/dist/components/Icon/BigIcon/BigIcon.module.cjs.map +1 -0
- package/dist/components/Icon/BigIcon/BigIcon.module.js +6 -0
- package/dist/components/Icon/BigIcon/BigIcon.module.js.map +1 -0
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.cjs +22 -22
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.cjs.map +1 -1
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.js +19 -22
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.js.map +1 -1
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.cjs +6 -0
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.cjs.map +1 -0
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.js +6 -0
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.js.map +1 -0
- package/dist/components/InlineSpinner/InlineSpinner.cjs +24 -21
- package/dist/components/InlineSpinner/InlineSpinner.cjs.map +1 -1
- package/dist/components/InlineSpinner/InlineSpinner.js +19 -20
- package/dist/components/InlineSpinner/InlineSpinner.js.map +1 -1
- package/dist/components/InlineSpinner/InlineSpinner.module.cjs +8 -0
- package/dist/components/InlineSpinner/InlineSpinner.module.cjs.map +1 -0
- package/dist/components/InlineSpinner/InlineSpinner.module.js +8 -0
- package/dist/components/InlineSpinner/InlineSpinner.module.js.map +1 -0
- package/dist/components/Link/Link.cjs +25 -23
- package/dist/components/Link/Link.cjs.map +1 -1
- package/dist/components/Link/Link.d.ts +5 -4
- package/dist/components/Link/Link.d.ts.map +1 -1
- package/dist/components/Link/Link.js +22 -23
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/Link/Link.module.cjs +5 -0
- package/dist/components/Link/Link.module.cjs.map +1 -0
- package/dist/components/Link/Link.module.js +5 -0
- package/dist/components/Link/Link.module.js.map +1 -0
- package/dist/components/Menu/CheckboxMenuItem.cjs +37 -39
- package/dist/components/Menu/CheckboxMenuItem.cjs.map +1 -1
- package/dist/components/Menu/CheckboxMenuItem.js +34 -38
- package/dist/components/Menu/CheckboxMenuItem.js.map +1 -1
- package/dist/components/Menu/ContextMenu.cjs +71 -62
- package/dist/components/Menu/ContextMenu.cjs.map +1 -1
- package/dist/components/Menu/ContextMenu.js +66 -60
- package/dist/components/Menu/ContextMenu.js.map +1 -1
- package/dist/components/Menu/DrawerMenu.cjs +27 -22
- package/dist/components/Menu/DrawerMenu.cjs.map +1 -1
- package/dist/components/Menu/DrawerMenu.js +23 -21
- package/dist/components/Menu/DrawerMenu.js.map +1 -1
- package/dist/components/Menu/DrawerMenu.module.cjs +9 -0
- package/dist/components/Menu/DrawerMenu.module.cjs.map +1 -0
- package/dist/components/Menu/DrawerMenu.module.js +9 -0
- package/dist/components/Menu/DrawerMenu.module.js.map +1 -0
- package/dist/components/Menu/FloatingMenu.cjs +31 -28
- package/dist/components/Menu/FloatingMenu.cjs.map +1 -1
- package/dist/components/Menu/FloatingMenu.js +27 -27
- package/dist/components/Menu/FloatingMenu.js.map +1 -1
- package/dist/components/Menu/FloatingMenu.module.cjs +14 -0
- package/dist/components/Menu/FloatingMenu.module.cjs.map +1 -0
- package/dist/components/Menu/FloatingMenu.module.js +14 -0
- package/dist/components/Menu/FloatingMenu.module.js.map +1 -0
- package/dist/components/Menu/Menu.cjs +68 -56
- package/dist/components/Menu/Menu.cjs.map +1 -1
- package/dist/components/Menu/Menu.js +63 -54
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/MenuContext.cjs +10 -5
- package/dist/components/Menu/MenuContext.cjs.map +1 -1
- package/dist/components/Menu/MenuContext.js +10 -5
- package/dist/components/Menu/MenuContext.js.map +1 -1
- package/dist/components/Menu/MenuItem.cjs +83 -95
- package/dist/components/Menu/MenuItem.cjs.map +1 -1
- package/dist/components/Menu/MenuItem.js +77 -93
- package/dist/components/Menu/MenuItem.js.map +1 -1
- package/dist/components/Menu/MenuItem.module.cjs +20 -0
- package/dist/components/Menu/MenuItem.module.cjs.map +1 -0
- package/dist/components/Menu/MenuItem.module.js +20 -0
- package/dist/components/Menu/MenuItem.module.js.map +1 -0
- package/dist/components/Menu/MenuTitle.cjs +21 -14
- package/dist/components/Menu/MenuTitle.cjs.map +1 -1
- package/dist/components/Menu/MenuTitle.js +17 -13
- package/dist/components/Menu/MenuTitle.js.map +1 -1
- package/dist/components/Menu/MenuTitle.module.cjs +6 -0
- package/dist/components/Menu/MenuTitle.module.cjs.map +1 -0
- package/dist/components/Menu/MenuTitle.module.js +6 -0
- package/dist/components/Menu/MenuTitle.module.js.map +1 -0
- package/dist/components/Menu/RadioMenuItem.cjs +35 -37
- package/dist/components/Menu/RadioMenuItem.cjs.map +1 -1
- package/dist/components/Menu/RadioMenuItem.js +32 -36
- package/dist/components/Menu/RadioMenuItem.js.map +1 -1
- package/dist/components/Menu/ToggleMenuItem.cjs +39 -41
- package/dist/components/Menu/ToggleMenuItem.cjs.map +1 -1
- package/dist/components/Menu/ToggleMenuItem.js +36 -40
- package/dist/components/Menu/ToggleMenuItem.js.map +1 -1
- package/dist/components/Nav/Nav.module.cjs +11 -0
- package/dist/components/Nav/Nav.module.cjs.map +1 -0
- package/dist/components/Nav/Nav.module.js +11 -0
- package/dist/components/Nav/Nav.module.js.map +1 -0
- package/dist/components/Nav/NavBar.cjs +47 -28
- package/dist/components/Nav/NavBar.cjs.map +1 -1
- package/dist/components/Nav/NavBar.js +44 -28
- package/dist/components/Nav/NavBar.js.map +1 -1
- package/dist/components/Nav/NavItem.cjs +70 -72
- package/dist/components/Nav/NavItem.cjs.map +1 -1
- package/dist/components/Nav/NavItem.js +68 -72
- package/dist/components/Nav/NavItem.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +19 -0
- package/dist/components/PageHeader/PageHeader.d.ts.map +1 -0
- package/dist/components/Progress/Progress.cjs +43 -56
- package/dist/components/Progress/Progress.cjs.map +1 -1
- package/dist/components/Progress/Progress.d.ts +2 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/Progress/Progress.js +40 -56
- package/dist/components/Progress/Progress.js.map +1 -1
- package/dist/components/Progress/Progress.module.cjs +11 -0
- package/dist/components/Progress/Progress.module.cjs.map +1 -0
- package/dist/components/Progress/Progress.module.js +11 -0
- package/dist/components/Progress/Progress.module.js.map +1 -0
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.cjs +108 -115
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.cjs.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.js +105 -114
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.js.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.cjs +11 -0
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.cjs.map +1 -0
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.js +11 -0
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.js.map +1 -0
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.cjs +16 -12
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.cjs.map +1 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.js +15 -13
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncementContext.js.map +1 -1
- package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.cjs +52 -62
- package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.cjs.map +1 -1
- package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.js +52 -63
- package/dist/components/ReleaseAnnouncement/useReleaseAnnouncement.js.map +1 -1
- package/dist/components/Search/Search.cjs +43 -36
- package/dist/components/Search/Search.cjs.map +1 -1
- package/dist/components/Search/Search.js +37 -34
- package/dist/components/Search/Search.js.map +1 -1
- package/dist/components/Search/Search.module.cjs +9 -0
- package/dist/components/Search/Search.module.cjs.map +1 -0
- package/dist/components/Search/Search.module.js +9 -0
- package/dist/components/Search/Search.module.js.map +1 -0
- package/dist/components/Separator/Separator.cjs +34 -57
- package/dist/components/Separator/Separator.cjs.map +1 -1
- package/dist/components/Separator/Separator.js +29 -39
- package/dist/components/Separator/Separator.js.map +1 -1
- package/dist/components/Separator/Separator.module.cjs +5 -0
- package/dist/components/Separator/Separator.module.cjs.map +1 -0
- package/dist/components/Separator/Separator.module.js +5 -0
- package/dist/components/Separator/Separator.module.js.map +1 -0
- package/dist/components/Toast/Toast.cjs +19 -10
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.js +15 -9
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toast/Toast.module.cjs +6 -0
- package/dist/components/Toast/Toast.module.cjs.map +1 -0
- package/dist/components/Toast/Toast.module.js +6 -0
- package/dist/components/Toast/Toast.module.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.cjs +103 -118
- package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +99 -117
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.module.cjs +10 -0
- package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -0
- package/dist/components/Tooltip/Tooltip.module.js +10 -0
- package/dist/components/Tooltip/Tooltip.module.js.map +1 -0
- package/dist/components/Tooltip/TooltipContext.cjs +16 -10
- package/dist/components/Tooltip/TooltipContext.cjs.map +1 -1
- package/dist/components/Tooltip/TooltipContext.js +15 -11
- package/dist/components/Tooltip/TooltipContext.js.map +1 -1
- package/dist/components/Tooltip/TooltipProvider.cjs +22 -7
- package/dist/components/Tooltip/TooltipProvider.cjs.map +1 -1
- package/dist/components/Tooltip/TooltipProvider.js +19 -7
- package/dist/components/Tooltip/TooltipProvider.js.map +1 -1
- package/dist/components/Tooltip/useTooltip.cjs +112 -139
- package/dist/components/Tooltip/useTooltip.cjs.map +1 -1
- package/dist/components/Tooltip/useTooltip.js +111 -139
- package/dist/components/Tooltip/useTooltip.js.map +1 -1
- package/dist/components/Typography/Body.cjs +17 -10
- package/dist/components/Typography/Body.cjs.map +1 -1
- package/dist/components/Typography/Body.js +15 -10
- package/dist/components/Typography/Body.js.map +1 -1
- package/dist/components/Typography/Heading.cjs +92 -20
- package/dist/components/Typography/Heading.cjs.map +1 -1
- package/dist/components/Typography/Heading.d.ts +2 -1
- package/dist/components/Typography/Heading.d.ts.map +1 -1
- package/dist/components/Typography/Heading.js +89 -25
- package/dist/components/Typography/Heading.js.map +1 -1
- package/dist/components/Typography/Text.cjs +20 -7
- package/dist/components/Typography/Text.cjs.map +1 -1
- package/dist/components/Typography/Text.d.ts +2 -1
- package/dist/components/Typography/Text.d.ts.map +1 -1
- package/dist/components/Typography/Text.js +18 -7
- package/dist/components/Typography/Text.js.map +1 -1
- package/dist/components/Typography/Typography.cjs +17 -28
- package/dist/components/Typography/Typography.cjs.map +1 -1
- package/dist/components/Typography/Typography.d.ts +2 -1
- package/dist/components/Typography/Typography.d.ts.map +1 -1
- package/dist/components/Typography/Typography.js +14 -28
- package/dist/components/Typography/Typography.js.map +1 -1
- package/dist/components/Typography/Typography.module.cjs +30 -0
- package/dist/components/Typography/Typography.module.cjs.map +1 -0
- package/dist/components/Typography/Typography.module.js +30 -0
- package/dist/components/Typography/Typography.module.js.map +1 -0
- package/dist/components/VisualList/VisualList.cjs +20 -12
- package/dist/components/VisualList/VisualList.cjs.map +1 -1
- package/dist/components/VisualList/VisualList.js +17 -12
- package/dist/components/VisualList/VisualList.js.map +1 -1
- package/dist/components/VisualList/VisualList.module.cjs +6 -0
- package/dist/components/VisualList/VisualList.module.cjs.map +1 -0
- package/dist/components/VisualList/VisualList.module.js +6 -0
- package/dist/components/VisualList/VisualList.module.js.map +1 -0
- package/dist/components/VisualList/VisualListItem.cjs +28 -36
- package/dist/components/VisualList/VisualListItem.cjs.map +1 -1
- package/dist/components/VisualList/VisualListItem.js +25 -36
- package/dist/components/VisualList/VisualListItem.js.map +1 -1
- package/dist/components/VisualList/VisualListItem.module.cjs +11 -0
- package/dist/components/VisualList/VisualListItem.module.cjs.map +1 -0
- package/dist/components/VisualList/VisualListItem.module.js +11 -0
- package/dist/components/VisualList/VisualListItem.module.js.map +1 -0
- package/dist/index.cjs +147 -139
- package/dist/index.js +36 -116
- package/dist/style.css +1609 -1601
- package/dist/utils/platform.cjs +12 -11
- package/dist/utils/platform.cjs.map +1 -1
- package/dist/utils/platform.js +13 -12
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/size.d.ts +5 -0
- package/dist/utils/size.d.ts.map +1 -0
- package/dist/utils/string.cjs +19 -19
- package/dist/utils/string.cjs.map +1 -1
- package/dist/utils/string.js +20 -20
- package/dist/utils/string.js.map +1 -1
- package/package.json +15 -15
- package/src/components/Avatar/Avatar.module.css +1 -1
- package/src/components/Avatar/avatar-clip.mask.svg +2 -6
- package/src/components/Breadcrumb/Breadcrumb.module.css +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Dropdown/Dropdown.module.css +1 -1
- package/src/components/Icon/BigIcon/BigIcon.module.css +11 -8
- package/src/components/Icon/BigIcon/BigIcon.tsx +11 -18
- package/src/components/Link/Link.module.css +5 -1
- package/src/components/Link/Link.tsx +6 -5
- package/src/components/Nav/Nav.module.css +1 -1
- package/src/components/PageHeader/PageHeader.module.css +41 -0
- package/src/components/PageHeader/PageHeader.tsx +67 -0
- package/src/components/Progress/Progress.tsx +2 -1
- package/src/components/Separator/Separator.module.css +2 -2
- package/src/components/Typography/Heading.tsx +2 -1
- package/src/components/Typography/Text.tsx +2 -1
- package/src/components/Typography/Typography.tsx +2 -1
- package/src/components/VisualList/VisualList.module.css +1 -1
- package/src/utils/size.ts +11 -0
- package/tsconfig.json +1 -0
- package/dist/components/ActivityMarker/Pill.module.css.cjs +0 -9
- package/dist/components/ActivityMarker/Pill.module.css.cjs.map +0 -1
- package/dist/components/ActivityMarker/Pill.module.css.js +0 -9
- package/dist/components/ActivityMarker/Pill.module.css.js.map +0 -1
- package/dist/components/ActivityMarker/Unread.module.css.cjs +0 -9
- package/dist/components/ActivityMarker/Unread.module.css.cjs.map +0 -1
- package/dist/components/ActivityMarker/Unread.module.css.js +0 -9
- package/dist/components/ActivityMarker/Unread.module.css.js.map +0 -1
- package/dist/components/ActivityMarker/UnreadCounter.module.css.cjs +0 -7
- package/dist/components/ActivityMarker/UnreadCounter.module.css.cjs.map +0 -1
- package/dist/components/ActivityMarker/UnreadCounter.module.css.js +0 -7
- package/dist/components/ActivityMarker/UnreadCounter.module.css.js.map +0 -1
- package/dist/components/Alert/Alert.module.css.cjs +0 -19
- package/dist/components/Alert/Alert.module.css.cjs.map +0 -1
- package/dist/components/Alert/Alert.module.css.js +0 -19
- package/dist/components/Alert/Alert.module.css.js.map +0 -1
- package/dist/components/Avatar/Avatar.module.css.cjs +0 -15
- package/dist/components/Avatar/Avatar.module.css.cjs.map +0 -1
- package/dist/components/Avatar/Avatar.module.css.js +0 -15
- package/dist/components/Avatar/Avatar.module.css.js.map +0 -1
- package/dist/components/Avatar/avatar-clip.mask.svg.cjs +0 -5
- package/dist/components/Avatar/avatar-clip.mask.svg.cjs.map +0 -1
- package/dist/components/Avatar/avatar-clip.mask.svg.js +0 -5
- package/dist/components/Avatar/avatar-clip.mask.svg.js.map +0 -1
- package/dist/components/Badge/Badge.module.css.cjs +0 -9
- package/dist/components/Badge/Badge.module.css.cjs.map +0 -1
- package/dist/components/Badge/Badge.module.css.js +0 -9
- package/dist/components/Badge/Badge.module.css.js.map +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs +0 -13
- package/dist/components/Breadcrumb/Breadcrumb.module.css.cjs.map +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js +0 -13
- package/dist/components/Breadcrumb/Breadcrumb.module.css.js.map +0 -1
- package/dist/components/Button/Button.module.css.cjs +0 -14
- package/dist/components/Button/Button.module.css.cjs.map +0 -1
- package/dist/components/Button/Button.module.css.js +0 -14
- package/dist/components/Button/Button.module.css.js.map +0 -1
- package/dist/components/Button/IconButton/IconButton.module.css.cjs +0 -11
- package/dist/components/Button/IconButton/IconButton.module.css.cjs.map +0 -1
- package/dist/components/Button/IconButton/IconButton.module.css.js +0 -11
- package/dist/components/Button/IconButton/IconButton.module.css.js.map +0 -1
- package/dist/components/ChatFilter/ChatFilter.module.css.cjs +0 -7
- package/dist/components/ChatFilter/ChatFilter.module.css.cjs.map +0 -1
- package/dist/components/ChatFilter/ChatFilter.module.css.js +0 -7
- package/dist/components/ChatFilter/ChatFilter.module.css.js.map +0 -1
- package/dist/components/Dropdown/Dropdown.module.css.cjs +0 -27
- package/dist/components/Dropdown/Dropdown.module.css.cjs.map +0 -1
- package/dist/components/Dropdown/Dropdown.module.css.js +0 -27
- package/dist/components/Dropdown/Dropdown.module.css.js.map +0 -1
- package/dist/components/Form/Controls/Action/Action.module.css.cjs +0 -15
- package/dist/components/Form/Controls/Action/Action.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/Action/Action.module.css.js +0 -15
- package/dist/components/Form/Controls/Action/Action.module.css.js.map +0 -1
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.cjs +0 -15
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.js +0 -15
- package/dist/components/Form/Controls/Checkbox/Checkbox.module.css.js.map +0 -1
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.css.cjs +0 -10
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.css.js +0 -10
- package/dist/components/Form/Controls/EditInPlace/EditInPlace.module.css.js.map +0 -1
- package/dist/components/Form/Controls/MFA/MFA.module.css.cjs +0 -15
- package/dist/components/Form/Controls/MFA/MFA.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/MFA/MFA.module.css.js +0 -15
- package/dist/components/Form/Controls/MFA/MFA.module.css.js.map +0 -1
- package/dist/components/Form/Controls/Radio/Radio.module.css.cjs +0 -15
- package/dist/components/Form/Controls/Radio/Radio.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/Radio/Radio.module.css.js +0 -15
- package/dist/components/Form/Controls/Radio/Radio.module.css.js.map +0 -1
- package/dist/components/Form/Controls/Text/Text.module.css.cjs +0 -10
- package/dist/components/Form/Controls/Text/Text.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/Text/Text.module.css.js +0 -10
- package/dist/components/Form/Controls/Text/Text.module.css.js.map +0 -1
- package/dist/components/Form/Controls/Toggle/Toggle.module.css.cjs +0 -15
- package/dist/components/Form/Controls/Toggle/Toggle.module.css.cjs.map +0 -1
- package/dist/components/Form/Controls/Toggle/Toggle.module.css.js +0 -15
- package/dist/components/Form/Controls/Toggle/Toggle.module.css.js.map +0 -1
- package/dist/components/Form/form.module.css.cjs +0 -24
- package/dist/components/Form/form.module.css.cjs.map +0 -1
- package/dist/components/Form/form.module.css.js +0 -24
- package/dist/components/Form/form.module.css.js.map +0 -1
- package/dist/components/Glass/Glass.module.css.cjs +0 -9
- package/dist/components/Glass/Glass.module.css.cjs.map +0 -1
- package/dist/components/Glass/Glass.module.css.js +0 -9
- package/dist/components/Glass/Glass.module.css.js.map +0 -1
- package/dist/components/Icon/BigIcon/BigIcon.module.css.cjs +0 -15
- package/dist/components/Icon/BigIcon/BigIcon.module.css.cjs.map +0 -1
- package/dist/components/Icon/BigIcon/BigIcon.module.css.js +0 -15
- package/dist/components/Icon/BigIcon/BigIcon.module.css.js.map +0 -1
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.css.cjs +0 -7
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.css.cjs.map +0 -1
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.css.js +0 -7
- package/dist/components/Icon/IndicatorIcon/IndicatorIcon.module.css.js.map +0 -1
- package/dist/components/InlineSpinner/InlineSpinner.module.css.cjs +0 -9
- package/dist/components/InlineSpinner/InlineSpinner.module.css.cjs.map +0 -1
- package/dist/components/InlineSpinner/InlineSpinner.module.css.js +0 -9
- package/dist/components/InlineSpinner/InlineSpinner.module.css.js.map +0 -1
- package/dist/components/Link/Link.module.css.cjs +0 -9
- package/dist/components/Link/Link.module.css.cjs.map +0 -1
- package/dist/components/Link/Link.module.css.js +0 -9
- package/dist/components/Link/Link.module.css.js.map +0 -1
- package/dist/components/Menu/DrawerMenu.module.css.cjs +0 -15
- package/dist/components/Menu/DrawerMenu.module.css.cjs.map +0 -1
- package/dist/components/Menu/DrawerMenu.module.css.js +0 -15
- package/dist/components/Menu/DrawerMenu.module.css.js.map +0 -1
- package/dist/components/Menu/FloatingMenu.module.css.cjs +0 -12
- package/dist/components/Menu/FloatingMenu.module.css.cjs.map +0 -1
- package/dist/components/Menu/FloatingMenu.module.css.js +0 -12
- package/dist/components/Menu/FloatingMenu.module.css.js.map +0 -1
- package/dist/components/Menu/MenuItem.module.css.cjs +0 -24
- package/dist/components/Menu/MenuItem.module.css.cjs.map +0 -1
- package/dist/components/Menu/MenuItem.module.css.js +0 -24
- package/dist/components/Menu/MenuItem.module.css.js.map +0 -1
- package/dist/components/Menu/MenuTitle.module.css.cjs +0 -7
- package/dist/components/Menu/MenuTitle.module.css.cjs.map +0 -1
- package/dist/components/Menu/MenuTitle.module.css.js +0 -7
- package/dist/components/Menu/MenuTitle.module.css.js.map +0 -1
- package/dist/components/Nav/Nav.module.css.cjs +0 -10
- package/dist/components/Nav/Nav.module.css.cjs.map +0 -1
- package/dist/components/Nav/Nav.module.css.js +0 -10
- package/dist/components/Nav/Nav.module.css.js.map +0 -1
- package/dist/components/Progress/Progress.module.css.cjs +0 -10
- package/dist/components/Progress/Progress.module.css.cjs.map +0 -1
- package/dist/components/Progress/Progress.module.css.js +0 -10
- package/dist/components/Progress/Progress.module.css.js.map +0 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.css.cjs +0 -21
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.css.cjs.map +0 -1
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.css.js +0 -21
- package/dist/components/ReleaseAnnouncement/ReleaseAnnouncement.module.css.js.map +0 -1
- package/dist/components/Search/Search.module.css.cjs +0 -15
- package/dist/components/Search/Search.module.css.cjs.map +0 -1
- package/dist/components/Search/Search.module.css.js +0 -15
- package/dist/components/Search/Search.module.css.js.map +0 -1
- package/dist/components/Separator/Separator.module.css.cjs +0 -9
- package/dist/components/Separator/Separator.module.css.cjs.map +0 -1
- package/dist/components/Separator/Separator.module.css.js +0 -9
- package/dist/components/Separator/Separator.module.css.js.map +0 -1
- package/dist/components/Toast/Toast.module.css.cjs +0 -7
- package/dist/components/Toast/Toast.module.css.cjs.map +0 -1
- package/dist/components/Toast/Toast.module.css.js +0 -7
- package/dist/components/Toast/Toast.module.css.js.map +0 -1
- package/dist/components/Tooltip/Tooltip.module.css.cjs +0 -18
- package/dist/components/Tooltip/Tooltip.module.css.cjs.map +0 -1
- package/dist/components/Tooltip/Tooltip.module.css.js +0 -18
- package/dist/components/Tooltip/Tooltip.module.css.js.map +0 -1
- package/dist/components/Typography/Typography.module.css.cjs +0 -30
- package/dist/components/Typography/Typography.module.css.cjs.map +0 -1
- package/dist/components/Typography/Typography.module.css.js +0 -30
- package/dist/components/Typography/Typography.module.css.js.map +0 -1
- package/dist/components/VisualList/VisualList.module.css.cjs +0 -7
- package/dist/components/VisualList/VisualList.module.css.cjs.map +0 -1
- package/dist/components/VisualList/VisualList.module.css.js +0 -7
- package/dist/components/VisualList/VisualList.module.css.js.map +0 -1
- package/dist/components/VisualList/VisualListItem.module.css.cjs +0 -10
- package/dist/components/VisualList/VisualListItem.module.css.cjs.map +0 -1
- package/dist/components/VisualList/VisualListItem.module.css.js +0 -10
- package/dist/components/VisualList/VisualListItem.module.css.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,69 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { forwardRef } from "react";
|
|
3
|
-
import styles from "./MFA.module.css.js";
|
|
1
|
+
import MFA_module_default from "./MFA.module.js";
|
|
4
2
|
import classNames from "classnames";
|
|
3
|
+
import React, { forwardRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Control } from "@radix-ui/react-form";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onMouseUp: update,
|
|
48
|
-
onChange: update,
|
|
49
|
-
ref
|
|
50
|
-
}
|
|
51
|
-
),
|
|
52
|
-
Array.from(Array(length).keys()).map((index) => /* @__PURE__ */ jsx(
|
|
53
|
-
Digit,
|
|
54
|
-
{
|
|
55
|
-
filled: index < currentLength,
|
|
56
|
-
selected: !!selection && index >= selection[0] && index < selection[1]
|
|
57
|
-
},
|
|
58
|
-
index
|
|
59
|
-
))
|
|
60
|
-
] });
|
|
6
|
+
//#region src/components/Form/Controls/MFA/MFA.tsx
|
|
7
|
+
var Digit = ({ filled, selected }) => /* @__PURE__ */ jsx("div", {
|
|
8
|
+
className: MFA_module_default.digit,
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
"data-filled": filled ? "" : void 0,
|
|
11
|
+
"data-selected": selected ? "" : void 0
|
|
12
|
+
});
|
|
13
|
+
var MFAInput = forwardRef(function MFAInput({ className, length = 6, ...props }, ref) {
|
|
14
|
+
const classes = classNames(MFA_module_default.container, className);
|
|
15
|
+
const [currentLength, setCurrentLength] = React.useState(0);
|
|
16
|
+
const [selection, setSelection] = React.useState(null);
|
|
17
|
+
const update = (event) => {
|
|
18
|
+
const input = event.currentTarget;
|
|
19
|
+
setCurrentLength(input.value?.length);
|
|
20
|
+
if (document.activeElement !== input || input.selectionStart === null || input.selectionEnd === null) setSelection(null);
|
|
21
|
+
else setSelection([input.selectionStart, input.selectionEnd]);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: classes,
|
|
25
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
26
|
+
...props,
|
|
27
|
+
inputMode: "numeric",
|
|
28
|
+
type: "text",
|
|
29
|
+
minLength: 0,
|
|
30
|
+
maxLength: length,
|
|
31
|
+
className: MFA_module_default.control,
|
|
32
|
+
pattern: `\\d{${length}}`,
|
|
33
|
+
autoComplete: "one-time-code",
|
|
34
|
+
onSelect: update,
|
|
35
|
+
onFocus: update,
|
|
36
|
+
onBlur: update,
|
|
37
|
+
onMouseDown: update,
|
|
38
|
+
onMouseMove: update,
|
|
39
|
+
onMouseUp: update,
|
|
40
|
+
onChange: update,
|
|
41
|
+
ref
|
|
42
|
+
}), Array.from(Array(length).keys()).map((index) => /* @__PURE__ */ jsx(Digit, {
|
|
43
|
+
filled: index < currentLength,
|
|
44
|
+
selected: !!selection && index >= selection[0] && index < selection[1]
|
|
45
|
+
}, index))]
|
|
46
|
+
});
|
|
61
47
|
});
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
var MFAControl = forwardRef(function ActionControl(props, ref) {
|
|
49
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
50
|
+
asChild: true,
|
|
51
|
+
children: /* @__PURE__ */ jsx(MFAInput, {
|
|
52
|
+
ref,
|
|
53
|
+
...props
|
|
54
|
+
})
|
|
55
|
+
});
|
|
64
56
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=MFA.js.map
|
|
57
|
+
//#endregion
|
|
58
|
+
export { MFAControl, MFAInput };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=MFA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MFA.js","sources":["../../../../../src/components/Form/Controls/MFA/MFA.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithoutRef,\n} from \"react\";\n\nimport styles from \"./MFA.module.css\";\nimport classNames from \"classnames\";\nimport { Control } from \"@radix-ui/react-form\";\n\ntype DigitProps = {\n filled: boolean;\n selected: boolean;\n};\n\nconst Digit: React.FC<DigitProps> = ({ filled, selected }) => (\n <div\n className={styles.digit}\n aria-hidden=\"true\"\n data-filled={filled ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n />\n);\n\ntype MFAProps = {\n className?: string;\n length?: number;\n disabled?: boolean;\n} & Omit<\n React.ComponentProps<\"input\">,\n \"type\" | \"inputMode\" | \"pattern\" | \"autoComplete\"\n>;\n\nexport const MFAInput = forwardRef(function MFAInput(\n { className, length = 6, ...props }: PropsWithoutRef<MFAProps>,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const classes = classNames(styles.container, className);\n const [currentLength, setCurrentLength] = React.useState(0);\n const [selection, setSelection] = React.useState<null | [number, number]>(\n null,\n );\n\n const update = (event: React.SyntheticEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n setCurrentLength(input.value?.length);\n\n if (\n document.activeElement !== input ||\n input.selectionStart === null ||\n input.selectionEnd === null\n ) {\n setSelection(null);\n } else {\n setSelection([input.selectionStart, input.selectionEnd]);\n }\n };\n\n return (\n <div className={classes}>\n <input\n {...props}\n inputMode=\"numeric\"\n // Showing digits on mobile browsers. Using numbers is not really suited\n // as it often adds a way to increment or decrement the current value\n // which is not interesting for this use case\n type=\"text\"\n minLength={0}\n maxLength={length}\n className={styles.control}\n pattern={`\\\\d{${length}}`}\n autoComplete=\"one-time-code\"\n onSelect={update}\n onFocus={update}\n onBlur={update}\n onMouseDown={update}\n onMouseMove={update}\n onMouseUp={update}\n onChange={update}\n ref={ref}\n />\n {Array.from(Array(length).keys()).map((index) => (\n <Digit\n key={index}\n filled={index < currentLength}\n selected={\n !!selection && index >= selection[0] && index < selection[1]\n }\n />\n ))}\n </div>\n );\n});\n\nexport const MFAControl = forwardRef<\n ComponentRef<typeof MFAInput>,\n ComponentProps<typeof MFAInput>\n>(function ActionControl(props, ref) {\n return (\n <Control asChild>\n <MFAInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"MFA.js","names":[],"sources":["../../../../../src/components/Form/Controls/MFA/MFA.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithoutRef,\n} from \"react\";\n\nimport styles from \"./MFA.module.css\";\nimport classNames from \"classnames\";\nimport { Control } from \"@radix-ui/react-form\";\n\ntype DigitProps = {\n filled: boolean;\n selected: boolean;\n};\n\nconst Digit: React.FC<DigitProps> = ({ filled, selected }) => (\n <div\n className={styles.digit}\n aria-hidden=\"true\"\n data-filled={filled ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n />\n);\n\ntype MFAProps = {\n className?: string;\n length?: number;\n disabled?: boolean;\n} & Omit<\n React.ComponentProps<\"input\">,\n \"type\" | \"inputMode\" | \"pattern\" | \"autoComplete\"\n>;\n\nexport const MFAInput = forwardRef(function MFAInput(\n { className, length = 6, ...props }: PropsWithoutRef<MFAProps>,\n ref: React.ForwardedRef<HTMLInputElement>,\n) {\n const classes = classNames(styles.container, className);\n const [currentLength, setCurrentLength] = React.useState(0);\n const [selection, setSelection] = React.useState<null | [number, number]>(\n null,\n );\n\n const update = (event: React.SyntheticEvent<HTMLInputElement>) => {\n const input = event.currentTarget;\n setCurrentLength(input.value?.length);\n\n if (\n document.activeElement !== input ||\n input.selectionStart === null ||\n input.selectionEnd === null\n ) {\n setSelection(null);\n } else {\n setSelection([input.selectionStart, input.selectionEnd]);\n }\n };\n\n return (\n <div className={classes}>\n <input\n {...props}\n inputMode=\"numeric\"\n // Showing digits on mobile browsers. Using numbers is not really suited\n // as it often adds a way to increment or decrement the current value\n // which is not interesting for this use case\n type=\"text\"\n minLength={0}\n maxLength={length}\n className={styles.control}\n pattern={`\\\\d{${length}}`}\n autoComplete=\"one-time-code\"\n onSelect={update}\n onFocus={update}\n onBlur={update}\n onMouseDown={update}\n onMouseMove={update}\n onMouseUp={update}\n onChange={update}\n ref={ref}\n />\n {Array.from(Array(length).keys()).map((index) => (\n <Digit\n key={index}\n filled={index < currentLength}\n selected={\n !!selection && index >= selection[0] && index < selection[1]\n }\n />\n ))}\n </div>\n );\n});\n\nexport const MFAControl = forwardRef<\n ComponentRef<typeof MFAInput>,\n ComponentProps<typeof MFAInput>\n>(function ActionControl(props, ref) {\n return (\n <Control asChild>\n <MFAInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"mappings":";;;;;;AAyBA,IAAM,SAA+B,EAAE,QAAQ,eAC7C,oBAAC,OAAD;CACE,WAAW,mBAAO;CAClB,eAAY;CACZ,eAAa,SAAS,KAAK,KAAA;CAC3B,iBAAe,WAAW,KAAK,KAAA;CAC/B,CAAA;AAYJ,IAAa,WAAW,WAAW,SAAS,SAC1C,EAAE,WAAW,SAAS,GAAG,GAAG,SAC5B,KACA;CACA,MAAM,UAAU,WAAW,mBAAO,WAAW,UAAU;CACvD,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,EAAE;CAC3D,MAAM,CAAC,WAAW,gBAAgB,MAAM,SACtC,KACD;CAED,MAAM,UAAU,UAAkD;EAChE,MAAM,QAAQ,MAAM;AACpB,mBAAiB,MAAM,OAAO,OAAO;AAErC,MACE,SAAS,kBAAkB,SAC3B,MAAM,mBAAmB,QACzB,MAAM,iBAAiB,KAEvB,cAAa,KAAK;MAElB,cAAa,CAAC,MAAM,gBAAgB,MAAM,aAAa,CAAC;;AAI5D,QACE,qBAAC,OAAD;EAAK,WAAW;YAAhB,CACE,oBAAC,SAAD;GACE,GAAI;GACJ,WAAU;GAIV,MAAK;GACL,WAAW;GACX,WAAW;GACX,WAAW,mBAAO;GAClB,SAAS,OAAO,OAAO;GACvB,cAAa;GACb,UAAU;GACV,SAAS;GACT,QAAQ;GACR,aAAa;GACb,aAAa;GACb,WAAW;GACX,UAAU;GACL;GACL,CAAA,EACD,MAAM,KAAK,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,UACrC,oBAAC,OAAD;GAEE,QAAQ,QAAQ;GAChB,UACE,CAAC,CAAC,aAAa,SAAS,UAAU,MAAM,QAAQ,UAAU;GAE5D,EALK,MAKL,CACF,CACE;;EAER;AAEF,IAAa,aAAa,WAGxB,SAAS,cAAc,OAAO,KAAK;AACnC,QACE,oBAAC,SAAD;EAAS,SAAA;YACP,oBAAC,UAAD;GAAe;GAAK,GAAI;GAAS,CAAA;EACzB,CAAA;EAEZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MFA.module.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/MFA/MFA.module.css"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n.container {\n --gap: var(--cpd-space-3x);\n --digit-size: var(--cpd-space-10x);\n --digit-height: var(--cpd-space-12x);\n\n display: flex;\n inline-size: fit-content;\n flex-direction: row;\n gap: var(--gap);\n\n /* The input is positioned absolutely\n so the container needs to be positioned relatively */\n position: relative;\n}\n\n.control {\n all: unset;\n\n /** TODO: semantic token */\n font-family: var(--cpd-font-family-mono), ui-monospace, monospace;\n font-weight: 700;\n\n /* Position the input to fill the container */\n position: absolute;\n inset: 0;\n\n /* Spacing between digits is set to the gap\n plus the size of one digit box\n minus the size of one character */\n letter-spacing: calc(var(--gap) + var(--digit-size) - 1ch);\n line-height: var(--digit-height);\n\n /* The padding at the start positions the first digit at the middle of the digit box */\n padding-inline-start: calc(var(--cpd-space-10x) / 2 - (1ch / 2));\n\n /* The negative margin at the end is to keep space for the cursor when the input is full */\n margin-inline-end: calc(-1 * (var(--cpd-space-10x) + var(--cpd-space-3x)));\n}\n\n.digit {\n box-sizing: border-box;\n inline-size: var(--cpd-space-10x);\n block-size: var(--cpd-space-12x);\n border: 1px solid var(--cpd-color-border-interactive-primary);\n background: var(--cpd-color-bg-canvas-default);\n border-radius: 0.5rem;\n padding: var(--cpd-space-3x) var(--cpd-space-4x);\n}\n\n@media (hover) {\n .control:hover ~ .digit {\n border-color: var(--cpd-color-border-interactive-hovered);\n\n /** TODO: have the shadow in the design tokens */\n box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);\n }\n}\n\n.control:disabled {\n color: var(--cpd-color-text-disabled);\n cursor: not-allowed;\n}\n\n.control:disabled ~ .digit {\n box-shadow: none;\n background: var(--cpd-color-bg-canvas-disabled);\n border-color: var(--cpd-color-border-disabled);\n}\n\n.control[readonly] {\n color: var(--cpd-color-text-secondary);\n}\n\n.control[readonly] ~ .digit {\n box-shadow: none;\n background: var(--cpd-color-bg-subtle-secondary);\n border-color: var(--cpd-color-bg-subtle-secondary);\n}\n\n.control[data-invalid] ~ .digit {\n border-color: var(--cpd-color-text-critical-primary);\n}\n\n.control:focus ~ .digit:not([data-filled]) {\n outline: 2px solid var(--cpd-color-border-focused);\n border-color: transparent;\n}\n\n.digit[data-selected] {\n border-color: var(--cpd-color-border-focused);\n background-color: var(--cpd-color-bg-info-subtle);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MFA.module.js","names":[],"sources":["../../../../../src/components/Form/Controls/MFA/MFA.module.css"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n.container {\n --gap: var(--cpd-space-3x);\n --digit-size: var(--cpd-space-10x);\n --digit-height: var(--cpd-space-12x);\n\n display: flex;\n inline-size: fit-content;\n flex-direction: row;\n gap: var(--gap);\n\n /* The input is positioned absolutely\n so the container needs to be positioned relatively */\n position: relative;\n}\n\n.control {\n all: unset;\n\n /** TODO: semantic token */\n font-family: var(--cpd-font-family-mono), ui-monospace, monospace;\n font-weight: 700;\n\n /* Position the input to fill the container */\n position: absolute;\n inset: 0;\n\n /* Spacing between digits is set to the gap\n plus the size of one digit box\n minus the size of one character */\n letter-spacing: calc(var(--gap) + var(--digit-size) - 1ch);\n line-height: var(--digit-height);\n\n /* The padding at the start positions the first digit at the middle of the digit box */\n padding-inline-start: calc(var(--cpd-space-10x) / 2 - (1ch / 2));\n\n /* The negative margin at the end is to keep space for the cursor when the input is full */\n margin-inline-end: calc(-1 * (var(--cpd-space-10x) + var(--cpd-space-3x)));\n}\n\n.digit {\n box-sizing: border-box;\n inline-size: var(--cpd-space-10x);\n block-size: var(--cpd-space-12x);\n border: 1px solid var(--cpd-color-border-interactive-primary);\n background: var(--cpd-color-bg-canvas-default);\n border-radius: 0.5rem;\n padding: var(--cpd-space-3x) var(--cpd-space-4x);\n}\n\n@media (hover) {\n .control:hover ~ .digit {\n border-color: var(--cpd-color-border-interactive-hovered);\n\n /** TODO: have the shadow in the design tokens */\n box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);\n }\n}\n\n.control:disabled {\n color: var(--cpd-color-text-disabled);\n cursor: not-allowed;\n}\n\n.control:disabled ~ .digit {\n box-shadow: none;\n background: var(--cpd-color-bg-canvas-disabled);\n border-color: var(--cpd-color-border-disabled);\n}\n\n.control[readonly] {\n color: var(--cpd-color-text-secondary);\n}\n\n.control[readonly] ~ .digit {\n box-shadow: none;\n background: var(--cpd-color-bg-subtle-secondary);\n border-color: var(--cpd-color-bg-subtle-secondary);\n}\n\n.control[data-invalid] ~ .digit {\n border-color: var(--cpd-color-text-critical-primary);\n}\n\n.control:focus ~ .digit:not([data-filled]) {\n outline: 2px solid var(--cpd-color-border-focused);\n border-color: transparent;\n}\n\n.digit[data-selected] {\n border-color: var(--cpd-color-border-focused);\n background-color: var(--cpd-color-bg-info-subtle);\n}\n"],"mappings":""}
|
|
@@ -1,43 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Action = require("../Action/Action.cjs");
|
|
3
|
+
let react = require("react");
|
|
4
|
+
react = require_runtime.__toESM(react);
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let _radix_ui_react_form = require("@radix-ui/react-form");
|
|
7
|
+
let _vector_im_compound_design_tokens_assets_web_icons_visibility_on = require("@vector-im/compound-design-tokens/assets/web/icons/visibility-on");
|
|
8
|
+
_vector_im_compound_design_tokens_assets_web_icons_visibility_on = require_runtime.__toESM(_vector_im_compound_design_tokens_assets_web_icons_visibility_on);
|
|
9
|
+
let _vector_im_compound_design_tokens_assets_web_icons_visibility_off = require("@vector-im/compound-design-tokens/assets/web/icons/visibility-off");
|
|
10
|
+
_vector_im_compound_design_tokens_assets_web_icons_visibility_off = require_runtime.__toESM(_vector_im_compound_design_tokens_assets_web_icons_visibility_off);
|
|
11
|
+
//#region src/components/Form/Controls/Password/Password.tsx
|
|
12
|
+
var showState = {
|
|
13
|
+
isHidden: true,
|
|
14
|
+
icon: _vector_im_compound_design_tokens_assets_web_icons_visibility_off.default,
|
|
15
|
+
label: "Show",
|
|
16
|
+
type: "password"
|
|
14
17
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var hideState = {
|
|
19
|
+
isHidden: false,
|
|
20
|
+
icon: _vector_im_compound_design_tokens_assets_web_icons_visibility_on.default,
|
|
21
|
+
label: "Hide",
|
|
22
|
+
type: "text"
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
24
|
+
/**
|
|
25
|
+
* A password input with a toggle to show/hide the password.
|
|
26
|
+
*
|
|
27
|
+
* Standalone input to be used outside of Radix forms.
|
|
28
|
+
*/
|
|
29
|
+
var PasswordInput = (0, react.forwardRef)(function PasswordControl(props, ref) {
|
|
30
|
+
const [{ icon, label, type }, togglePasswordVisibility] = (0, react.useReducer)((state) => !state.isHidden ? showState : hideState, showState);
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Action.ActionInput, {
|
|
32
|
+
ref,
|
|
33
|
+
...props,
|
|
34
|
+
Icon: icon,
|
|
35
|
+
actionLabel: label,
|
|
36
|
+
onActionClick: () => togglePasswordVisibility(),
|
|
37
|
+
type
|
|
38
|
+
});
|
|
37
39
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
/**
|
|
41
|
+
* A password input with a toggle to show/hide the password.
|
|
42
|
+
*
|
|
43
|
+
* Control to be used in a Radix form.
|
|
44
|
+
*/
|
|
45
|
+
var PasswordControl = (0, react.forwardRef)(function PasswordControl(props, ref) {
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_form.Control, {
|
|
47
|
+
asChild: true,
|
|
48
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PasswordInput, {
|
|
49
|
+
ref,
|
|
50
|
+
...props
|
|
51
|
+
})
|
|
52
|
+
});
|
|
40
53
|
});
|
|
54
|
+
//#endregion
|
|
41
55
|
exports.PasswordControl = PasswordControl;
|
|
42
56
|
exports.PasswordInput = PasswordInput;
|
|
43
|
-
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=Password.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Password.cjs","sources":["../../../../../src/components/Form/Controls/Password/Password.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\nimport React, {\n type ComponentRef,\n forwardRef,\n type ComponentProps,\n useReducer,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport { ActionInput } from \"../Action\";\n\nimport VisibilityOn from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-on\";\nimport VisibilityOff from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-off\";\n\nconst showState = {\n isHidden: true,\n icon: VisibilityOff,\n label: \"Show\",\n type: \"password\",\n};\n\nconst hideState = {\n isHidden: false,\n icon: VisibilityOn,\n label: \"Hide\",\n type: \"text\",\n};\n\ntype Props = Omit<\n ComponentProps<typeof ActionInput>,\n \"type\" | \"actionLabel\" | \"onActionClick\" | \"Icon\"\n>;\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Standalone input to be used outside of Radix forms.\n */\nexport const PasswordInput = forwardRef<\n ComponentRef<typeof ActionInput>,\n Props\n>(function PasswordControl(props, ref) {\n const [{ icon, label, type }, togglePasswordVisibility] = useReducer(\n (state) => (!state.isHidden ? showState : hideState),\n showState,\n );\n\n return (\n <ActionInput\n ref={ref}\n {...props}\n Icon={icon}\n // TODO: Replace with a function that deal with i18n of those values\n actionLabel={label}\n onActionClick={() => togglePasswordVisibility()}\n type={type}\n />\n );\n});\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Control to be used in a Radix form.\n */\nexport const PasswordControl = forwardRef<\n ComponentRef<typeof PasswordInput>,\n ComponentProps<typeof PasswordInput>\n>(function PasswordControl(props, ref) {\n return (\n <Control asChild>\n <PasswordInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"Password.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Password/Password.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\nimport React, {\n type ComponentRef,\n forwardRef,\n type ComponentProps,\n useReducer,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport { ActionInput } from \"../Action\";\n\nimport VisibilityOn from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-on\";\nimport VisibilityOff from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-off\";\n\nconst showState = {\n isHidden: true,\n icon: VisibilityOff,\n label: \"Show\",\n type: \"password\",\n};\n\nconst hideState = {\n isHidden: false,\n icon: VisibilityOn,\n label: \"Hide\",\n type: \"text\",\n};\n\ntype Props = Omit<\n ComponentProps<typeof ActionInput>,\n \"type\" | \"actionLabel\" | \"onActionClick\" | \"Icon\"\n>;\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Standalone input to be used outside of Radix forms.\n */\nexport const PasswordInput = forwardRef<\n ComponentRef<typeof ActionInput>,\n Props\n>(function PasswordControl(props, ref) {\n const [{ icon, label, type }, togglePasswordVisibility] = useReducer(\n (state) => (!state.isHidden ? showState : hideState),\n showState,\n );\n\n return (\n <ActionInput\n ref={ref}\n {...props}\n Icon={icon}\n // TODO: Replace with a function that deal with i18n of those values\n actionLabel={label}\n onActionClick={() => togglePasswordVisibility()}\n type={type}\n />\n );\n});\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Control to be used in a Radix form.\n */\nexport const PasswordControl = forwardRef<\n ComponentRef<typeof PasswordInput>,\n ComponentProps<typeof PasswordInput>\n>(function PasswordControl(props, ref) {\n return (\n <Control asChild>\n <PasswordInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,YAAY;CAChB,UAAU;CACV,MAAM,kEAAA;CACN,OAAO;CACP,MAAM;CACP;AAED,IAAM,YAAY;CAChB,UAAU;CACV,MAAM,iEAAA;CACN,OAAO;CACP,MAAM;CACP;;;;;;AAYD,IAAa,iBAAA,GAAA,MAAA,YAGX,SAAS,gBAAgB,OAAO,KAAK;CACrC,MAAM,CAAC,EAAE,MAAM,OAAO,QAAQ,6BAAA,GAAA,MAAA,aAC3B,UAAW,CAAC,MAAM,WAAW,YAAY,WAC1C,UACD;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,eAAA,aAAD;EACO;EACL,GAAI;EACJ,MAAM;EAEN,aAAa;EACb,qBAAqB,0BAA0B;EACzC;EACN,CAAA;EAEJ;;;;;;AAOF,IAAa,mBAAA,GAAA,MAAA,YAGX,SAAS,gBAAgB,OAAO,KAAK;AACrC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EAAS,SAAA;YACP,iBAAA,GAAA,kBAAA,KAAC,eAAD;GAAoB;GAAK,GAAI;GAAS,CAAA;EAC9B,CAAA;EAEZ"}
|
|
@@ -1,43 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionInput } from "../Action/Action.js";
|
|
2
2
|
import { forwardRef, useReducer } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { Control } from "@radix-ui/react-form";
|
|
4
5
|
import VisibilityOn from "@vector-im/compound-design-tokens/assets/web/icons/visibility-on";
|
|
5
6
|
import VisibilityOff from "@vector-im/compound-design-tokens/assets/web/icons/visibility-off";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
//#region src/components/Form/Controls/Password/Password.tsx
|
|
8
|
+
var showState = {
|
|
9
|
+
isHidden: true,
|
|
10
|
+
icon: VisibilityOff,
|
|
11
|
+
label: "Show",
|
|
12
|
+
type: "password"
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
var hideState = {
|
|
15
|
+
isHidden: false,
|
|
16
|
+
icon: VisibilityOn,
|
|
17
|
+
label: "Hide",
|
|
18
|
+
type: "text"
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
20
|
+
/**
|
|
21
|
+
* A password input with a toggle to show/hide the password.
|
|
22
|
+
*
|
|
23
|
+
* Standalone input to be used outside of Radix forms.
|
|
24
|
+
*/
|
|
25
|
+
var PasswordInput = forwardRef(function PasswordControl(props, ref) {
|
|
26
|
+
const [{ icon, label, type }, togglePasswordVisibility] = useReducer((state) => !state.isHidden ? showState : hideState, showState);
|
|
27
|
+
return /* @__PURE__ */ jsx(ActionInput, {
|
|
28
|
+
ref,
|
|
29
|
+
...props,
|
|
30
|
+
Icon: icon,
|
|
31
|
+
actionLabel: label,
|
|
32
|
+
onActionClick: () => togglePasswordVisibility(),
|
|
33
|
+
type
|
|
34
|
+
});
|
|
35
35
|
});
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* A password input with a toggle to show/hide the password.
|
|
38
|
+
*
|
|
39
|
+
* Control to be used in a Radix form.
|
|
40
|
+
*/
|
|
41
|
+
var PasswordControl = forwardRef(function PasswordControl(props, ref) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
43
|
+
asChild: true,
|
|
44
|
+
children: /* @__PURE__ */ jsx(PasswordInput, {
|
|
45
|
+
ref,
|
|
46
|
+
...props
|
|
47
|
+
})
|
|
48
|
+
});
|
|
38
49
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=Password.js.map
|
|
50
|
+
//#endregion
|
|
51
|
+
export { PasswordControl, PasswordInput };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=Password.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Password.js","sources":["../../../../../src/components/Form/Controls/Password/Password.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\nimport React, {\n type ComponentRef,\n forwardRef,\n type ComponentProps,\n useReducer,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport { ActionInput } from \"../Action\";\n\nimport VisibilityOn from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-on\";\nimport VisibilityOff from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-off\";\n\nconst showState = {\n isHidden: true,\n icon: VisibilityOff,\n label: \"Show\",\n type: \"password\",\n};\n\nconst hideState = {\n isHidden: false,\n icon: VisibilityOn,\n label: \"Hide\",\n type: \"text\",\n};\n\ntype Props = Omit<\n ComponentProps<typeof ActionInput>,\n \"type\" | \"actionLabel\" | \"onActionClick\" | \"Icon\"\n>;\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Standalone input to be used outside of Radix forms.\n */\nexport const PasswordInput = forwardRef<\n ComponentRef<typeof ActionInput>,\n Props\n>(function PasswordControl(props, ref) {\n const [{ icon, label, type }, togglePasswordVisibility] = useReducer(\n (state) => (!state.isHidden ? showState : hideState),\n showState,\n );\n\n return (\n <ActionInput\n ref={ref}\n {...props}\n Icon={icon}\n // TODO: Replace with a function that deal with i18n of those values\n actionLabel={label}\n onActionClick={() => togglePasswordVisibility()}\n type={type}\n />\n );\n});\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Control to be used in a Radix form.\n */\nexport const PasswordControl = forwardRef<\n ComponentRef<typeof PasswordInput>,\n ComponentProps<typeof PasswordInput>\n>(function PasswordControl(props, ref) {\n return (\n <Control asChild>\n <PasswordInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"Password.js","names":[],"sources":["../../../../../src/components/Form/Controls/Password/Password.tsx"],"sourcesContent":["/*\nCopyright 2023 New Vector Ltd.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\nimport React, {\n type ComponentRef,\n forwardRef,\n type ComponentProps,\n useReducer,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport { ActionInput } from \"../Action\";\n\nimport VisibilityOn from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-on\";\nimport VisibilityOff from \"@vector-im/compound-design-tokens/assets/web/icons/visibility-off\";\n\nconst showState = {\n isHidden: true,\n icon: VisibilityOff,\n label: \"Show\",\n type: \"password\",\n};\n\nconst hideState = {\n isHidden: false,\n icon: VisibilityOn,\n label: \"Hide\",\n type: \"text\",\n};\n\ntype Props = Omit<\n ComponentProps<typeof ActionInput>,\n \"type\" | \"actionLabel\" | \"onActionClick\" | \"Icon\"\n>;\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Standalone input to be used outside of Radix forms.\n */\nexport const PasswordInput = forwardRef<\n ComponentRef<typeof ActionInput>,\n Props\n>(function PasswordControl(props, ref) {\n const [{ icon, label, type }, togglePasswordVisibility] = useReducer(\n (state) => (!state.isHidden ? showState : hideState),\n showState,\n );\n\n return (\n <ActionInput\n ref={ref}\n {...props}\n Icon={icon}\n // TODO: Replace with a function that deal with i18n of those values\n actionLabel={label}\n onActionClick={() => togglePasswordVisibility()}\n type={type}\n />\n );\n});\n\n/**\n * A password input with a toggle to show/hide the password.\n *\n * Control to be used in a Radix form.\n */\nexport const PasswordControl = forwardRef<\n ComponentRef<typeof PasswordInput>,\n ComponentProps<typeof PasswordInput>\n>(function PasswordControl(props, ref) {\n return (\n <Control asChild>\n <PasswordInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"mappings":";;;;;;;AAmBA,IAAM,YAAY;CAChB,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACP;AAED,IAAM,YAAY;CAChB,UAAU;CACV,MAAM;CACN,OAAO;CACP,MAAM;CACP;;;;;;AAYD,IAAa,gBAAgB,WAG3B,SAAS,gBAAgB,OAAO,KAAK;CACrC,MAAM,CAAC,EAAE,MAAM,OAAO,QAAQ,4BAA4B,YACvD,UAAW,CAAC,MAAM,WAAW,YAAY,WAC1C,UACD;AAED,QACE,oBAAC,aAAD;EACO;EACL,GAAI;EACJ,MAAM;EAEN,aAAa;EACb,qBAAqB,0BAA0B;EACzC;EACN,CAAA;EAEJ;;;;;;AAOF,IAAa,kBAAkB,WAG7B,SAAS,gBAAgB,OAAO,KAAK;AACrC,QACE,oBAAC,SAAD;EAAS,SAAA;YACP,oBAAC,eAAD;GAAoB;GAAK,GAAI;GAAS,CAAA;EAC9B,CAAA;EAEZ"}
|
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_Radio_module = require("./Radio.module.cjs");
|
|
3
|
+
let classnames = require("classnames");
|
|
4
|
+
classnames = require_runtime.__toESM(classnames);
|
|
5
|
+
let react = require("react");
|
|
6
|
+
react = require_runtime.__toESM(react);
|
|
7
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _radix_ui_react_form = require("@radix-ui/react-form");
|
|
9
|
+
//#region src/components/Form/Controls/Radio/Radio.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A radio component.
|
|
12
|
+
*/
|
|
13
|
+
var RadioInput = (0, react.forwardRef)(function Radio({ className, ...props }, ref) {
|
|
14
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
15
|
+
className: (0, classnames.default)(require_Radio_module.default.container, className),
|
|
16
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
17
|
+
ref,
|
|
18
|
+
...props,
|
|
19
|
+
className: require_Radio_module.default.input,
|
|
20
|
+
type: "radio"
|
|
21
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_Radio_module.default.ui })]
|
|
22
|
+
});
|
|
14
23
|
});
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
var RadioControl = (0, react.forwardRef)(function RadioControl(props, ref) {
|
|
25
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_form.Control, {
|
|
26
|
+
asChild: true,
|
|
27
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioInput, {
|
|
28
|
+
ref,
|
|
29
|
+
...props
|
|
30
|
+
})
|
|
31
|
+
});
|
|
17
32
|
});
|
|
33
|
+
//#endregion
|
|
18
34
|
exports.RadioControl = RadioControl;
|
|
19
35
|
exports.RadioInput = RadioInput;
|
|
20
|
-
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=Radio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.cjs","sources":["../../../../../src/components/Form/Controls/Radio/Radio.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithChildren,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Radio.module.css\";\n\ntype RadioProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n} & Omit<React.ComponentPropsWithoutRef<\"input\">, \"type\">;\n\n/**\n * A radio component.\n */\nexport const RadioInput = forwardRef<\n HTMLInputElement,\n PropsWithChildren<RadioProps>\n>(function Radio({ className, ...props }, ref) {\n const classes = classnames(styles.container, className);\n return (\n <div className={classes}>\n <input ref={ref} {...props} className={styles.input} type=\"radio\" />\n <div className={styles.ui} />\n </div>\n );\n});\n\nexport const RadioControl = forwardRef<\n ComponentRef<typeof RadioInput>,\n ComponentProps<typeof RadioInput>\n>(function RadioControl(props, ref) {\n return (\n <Control asChild>\n <RadioInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"Radio.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Radio/Radio.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithChildren,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Radio.module.css\";\n\ntype RadioProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n} & Omit<React.ComponentPropsWithoutRef<\"input\">, \"type\">;\n\n/**\n * A radio component.\n */\nexport const RadioInput = forwardRef<\n HTMLInputElement,\n PropsWithChildren<RadioProps>\n>(function Radio({ className, ...props }, ref) {\n const classes = classnames(styles.container, className);\n return (\n <div className={classes}>\n <input ref={ref} {...props} className={styles.input} type=\"radio\" />\n <div className={styles.ui} />\n </div>\n );\n});\n\nexport const RadioControl = forwardRef<\n ComponentRef<typeof RadioInput>,\n ComponentProps<typeof RadioInput>\n>(function RadioControl(props, ref) {\n return (\n <Control asChild>\n <RadioInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAa,cAAA,GAAA,MAAA,YAGX,SAAS,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK;AAE7C,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,YAAA,GAAA,WAAA,SAFoB,qBAAA,QAAO,WAAW,UAAU;YAErD,CACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;GAAY;GAAK,GAAI;GAAO,WAAW,qBAAA,QAAO;GAAO,MAAK;GAAU,CAAA,EACpE,iBAAA,GAAA,kBAAA,KAAC,OAAD,EAAK,WAAW,qBAAA,QAAO,IAAM,CAAA,CACzB;;EAER;AAEF,IAAa,gBAAA,GAAA,MAAA,YAGX,SAAS,aAAa,OAAO,KAAK;AAClC,QACE,iBAAA,GAAA,kBAAA,KAAC,qBAAA,SAAD;EAAS,SAAA;YACP,iBAAA,GAAA,kBAAA,KAAC,YAAD;GAAiB;GAAK,GAAI;GAAS,CAAA;EAC3B,CAAA;EAEZ"}
|
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Radio_module_default from "./Radio.module.js";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { Control } from "@radix-ui/react-form";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
//#region src/components/Form/Controls/Radio/Radio.tsx
|
|
7
|
+
/**
|
|
8
|
+
* A radio component.
|
|
9
|
+
*/
|
|
10
|
+
var RadioInput = forwardRef(function Radio({ className, ...props }, ref) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: classNames(Radio_module_default.container, className),
|
|
13
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
14
|
+
ref,
|
|
15
|
+
...props,
|
|
16
|
+
className: Radio_module_default.input,
|
|
17
|
+
type: "radio"
|
|
18
|
+
}), /* @__PURE__ */ jsx("div", { className: Radio_module_default.ui })]
|
|
19
|
+
});
|
|
12
20
|
});
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
var RadioControl = forwardRef(function RadioControl(props, ref) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Control, {
|
|
23
|
+
asChild: true,
|
|
24
|
+
children: /* @__PURE__ */ jsx(RadioInput, {
|
|
25
|
+
ref,
|
|
26
|
+
...props
|
|
27
|
+
})
|
|
28
|
+
});
|
|
15
29
|
});
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=Radio.js.map
|
|
30
|
+
//#endregion
|
|
31
|
+
export { RadioControl, RadioInput };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../../../src/components/Form/Controls/Radio/Radio.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithChildren,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Radio.module.css\";\n\ntype RadioProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n} & Omit<React.ComponentPropsWithoutRef<\"input\">, \"type\">;\n\n/**\n * A radio component.\n */\nexport const RadioInput = forwardRef<\n HTMLInputElement,\n PropsWithChildren<RadioProps>\n>(function Radio({ className, ...props }, ref) {\n const classes = classnames(styles.container, className);\n return (\n <div className={classes}>\n <input ref={ref} {...props} className={styles.input} type=\"radio\" />\n <div className={styles.ui} />\n </div>\n );\n});\n\nexport const RadioControl = forwardRef<\n ComponentRef<typeof RadioInput>,\n ComponentProps<typeof RadioInput>\n>(function RadioControl(props, ref) {\n return (\n <Control asChild>\n <RadioInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"
|
|
1
|
+
{"version":3,"file":"Radio.js","names":[],"sources":["../../../../../src/components/Form/Controls/Radio/Radio.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport classnames from \"classnames\";\nimport React, {\n type ComponentProps,\n type ComponentRef,\n forwardRef,\n type PropsWithChildren,\n} from \"react\";\nimport { Control } from \"@radix-ui/react-form\";\n\nimport styles from \"./Radio.module.css\";\n\ntype RadioProps = {\n /**\n * The CSS class name.\n */\n className?: string;\n} & Omit<React.ComponentPropsWithoutRef<\"input\">, \"type\">;\n\n/**\n * A radio component.\n */\nexport const RadioInput = forwardRef<\n HTMLInputElement,\n PropsWithChildren<RadioProps>\n>(function Radio({ className, ...props }, ref) {\n const classes = classnames(styles.container, className);\n return (\n <div className={classes}>\n <input ref={ref} {...props} className={styles.input} type=\"radio\" />\n <div className={styles.ui} />\n </div>\n );\n});\n\nexport const RadioControl = forwardRef<\n ComponentRef<typeof RadioInput>,\n ComponentProps<typeof RadioInput>\n>(function RadioControl(props, ref) {\n return (\n <Control asChild>\n <RadioInput ref={ref} {...props} />\n </Control>\n );\n});\n"],"mappings":";;;;;;;;;AA8BA,IAAa,aAAa,WAGxB,SAAS,MAAM,EAAE,WAAW,GAAG,SAAS,KAAK;AAE7C,QACE,qBAAC,OAAD;EAAK,WAFS,WAAW,qBAAO,WAAW,UAAU;YAErD,CACE,oBAAC,SAAD;GAAY;GAAK,GAAI;GAAO,WAAW,qBAAO;GAAO,MAAK;GAAU,CAAA,EACpE,oBAAC,OAAD,EAAK,WAAW,qBAAO,IAAM,CAAA,CACzB;;EAER;AAEF,IAAa,eAAe,WAG1B,SAAS,aAAa,OAAO,KAAK;AAClC,QACE,oBAAC,SAAD;EAAS,SAAA;YACP,oBAAC,YAAD;GAAiB;GAAK,GAAI;GAAS,CAAA;EAC3B,CAAA;EAEZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.module.cjs","names":[],"sources":["../../../../../src/components/Form/Controls/Radio/Radio.module.css"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n.container {\n --size: 20px;\n\n display: grid;\n inline-size: var(--size);\n block-size: var(--size);\n}\n\n.input,\n.ui {\n box-sizing: border-box;\n grid-area: 1/1;\n inline-size: var(--size);\n block-size: var(--size);\n}\n\n.input {\n opacity: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.ui {\n pointer-events: none;\n border-radius: 50%;\n border: 1px solid;\n border-color: var(--cpd-color-border-interactive-primary);\n\n /* To align the ::after pseudo-element to the center of the radio button */\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.ui::after {\n content: \"\";\n inline-size: 6px;\n block-size: 6px;\n border-radius: 50%;\n background: transparent;\n box-sizing: border-box;\n\n /* Additional style to ensure visibility in contrast-mode */\n border: 1px solid transparent;\n color: transparent;\n}\n\n.input:checked + .ui {\n background-color: var(--cpd-color-bg-accent-rest);\n border-color: var(--cpd-color-bg-accent-rest);\n color: unset;\n}\n\n.input:checked + .ui::after {\n background: var(--cpd-color-icon-on-solid-primary);\n border-color: var(--cpd-color-icon-on-solid-primary);\n color: unset;\n}\n\n.input:focus-visible + .ui {\n outline: 2px solid var(--cpd-color-border-focused);\n outline-offset: 1px;\n}\n\n.input[readonly] {\n pointer-events: none;\n}\n\n.input[readonly] + .ui {\n border-color: var(--cpd-color-border-interactive-secondary);\n background: var(--cpd-color-bg-subtle-secondary);\n}\n\n.input[disabled] {\n cursor: not-allowed;\n}\n\n.input[disabled] + .ui {\n border-color: var(--cpd-color-border-disabled);\n background: var(--cpd-color-bg-canvas-disabled);\n}\n\n.input[disabled]:checked + .ui {\n border-color: var(--cpd-color-bg-action-primary-disabled);\n background: var(--cpd-color-bg-action-primary-disabled);\n}\n\n.input[readonly]:checked + .ui::after {\n background-color: var(--cpd-color-icon-secondary);\n border-color: var(--cpd-color-icon-secondary);\n color: unset;\n}\n\n@media (hover) {\n .input:not([disabled], [readonly], :checked):hover + .ui {\n border-color: var(--cpd-color-bg-accent-hovered);\n\n /** TODO: have the shadow in the design tokens */\n box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);\n }\n\n .input:not([disabled], [readonly], :checked):hover + .ui::after {\n background: var(--cpd-color-icon-quaternary);\n border-color: var(--cpd-color-icon-quaternary);\n color: unset;\n }\n\n .input:not([disabled], [readonly]):checked:hover + .ui {\n border-color: var(--cpd-color-bg-accent-hovered);\n background: var(--cpd-color-bg-accent-hovered);\n }\n\n .input[data-invalid]:not([disabled], [readonly]):checked:hover + .ui {\n border-color: var(--cpd-color-bg-critical-hovered);\n background: var(--cpd-color-bg-critical-hovered);\n }\n}\n\n.input[data-invalid]:not([disabled], [readonly], :checked) + .ui {\n border-color: var(--cpd-color-border-critical-primary);\n}\n\n.input[data-invalid]:not([disabled], [readonly]):checked + .ui {\n background-color: var(--cpd-color-bg-critical-primary);\n border-color: var(--cpd-color-bg-critical-primary);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.module.js","names":[],"sources":["../../../../../src/components/Form/Controls/Radio/Radio.module.css"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\nCopyright 2023 New Vector Ltd\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\n.container {\n --size: 20px;\n\n display: grid;\n inline-size: var(--size);\n block-size: var(--size);\n}\n\n.input,\n.ui {\n box-sizing: border-box;\n grid-area: 1/1;\n inline-size: var(--size);\n block-size: var(--size);\n}\n\n.input {\n opacity: 0;\n margin: 0;\n cursor: pointer;\n}\n\n.ui {\n pointer-events: none;\n border-radius: 50%;\n border: 1px solid;\n border-color: var(--cpd-color-border-interactive-primary);\n\n /* To align the ::after pseudo-element to the center of the radio button */\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.ui::after {\n content: \"\";\n inline-size: 6px;\n block-size: 6px;\n border-radius: 50%;\n background: transparent;\n box-sizing: border-box;\n\n /* Additional style to ensure visibility in contrast-mode */\n border: 1px solid transparent;\n color: transparent;\n}\n\n.input:checked + .ui {\n background-color: var(--cpd-color-bg-accent-rest);\n border-color: var(--cpd-color-bg-accent-rest);\n color: unset;\n}\n\n.input:checked + .ui::after {\n background: var(--cpd-color-icon-on-solid-primary);\n border-color: var(--cpd-color-icon-on-solid-primary);\n color: unset;\n}\n\n.input:focus-visible + .ui {\n outline: 2px solid var(--cpd-color-border-focused);\n outline-offset: 1px;\n}\n\n.input[readonly] {\n pointer-events: none;\n}\n\n.input[readonly] + .ui {\n border-color: var(--cpd-color-border-interactive-secondary);\n background: var(--cpd-color-bg-subtle-secondary);\n}\n\n.input[disabled] {\n cursor: not-allowed;\n}\n\n.input[disabled] + .ui {\n border-color: var(--cpd-color-border-disabled);\n background: var(--cpd-color-bg-canvas-disabled);\n}\n\n.input[disabled]:checked + .ui {\n border-color: var(--cpd-color-bg-action-primary-disabled);\n background: var(--cpd-color-bg-action-primary-disabled);\n}\n\n.input[readonly]:checked + .ui::after {\n background-color: var(--cpd-color-icon-secondary);\n border-color: var(--cpd-color-icon-secondary);\n color: unset;\n}\n\n@media (hover) {\n .input:not([disabled], [readonly], :checked):hover + .ui {\n border-color: var(--cpd-color-bg-accent-hovered);\n\n /** TODO: have the shadow in the design tokens */\n box-shadow: 0 1.2px 2.4px 0 rgb(0 0 0 / 15%);\n }\n\n .input:not([disabled], [readonly], :checked):hover + .ui::after {\n background: var(--cpd-color-icon-quaternary);\n border-color: var(--cpd-color-icon-quaternary);\n color: unset;\n }\n\n .input:not([disabled], [readonly]):checked:hover + .ui {\n border-color: var(--cpd-color-bg-accent-hovered);\n background: var(--cpd-color-bg-accent-hovered);\n }\n\n .input[data-invalid]:not([disabled], [readonly]):checked:hover + .ui {\n border-color: var(--cpd-color-bg-critical-hovered);\n background: var(--cpd-color-bg-critical-hovered);\n }\n}\n\n.input[data-invalid]:not([disabled], [readonly], :checked) + .ui {\n border-color: var(--cpd-color-border-critical-primary);\n}\n\n.input[data-invalid]:not([disabled], [readonly]):checked + .ui {\n background-color: var(--cpd-color-bg-critical-primary);\n border-color: var(--cpd-color-bg-critical-primary);\n}\n"],"mappings":""}
|