@radix-ng/primitives 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/accordion/index.d.ts +16 -0
- package/accordion/src/accordion-content.directive.d.ts +11 -0
- package/accordion/src/accordion-header.directive.d.ts +7 -0
- package/accordion/src/accordion-item.directive.d.ts +82 -0
- package/accordion/src/accordion-root.directive.d.ts +93 -0
- package/accordion/src/accordion-trigger.directive.d.ts +15 -0
- package/alert-dialog/{index.ts → index.d.ts} +0 -1
- package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +7 -0
- package/alert-dialog/src/alert-dialog-content.directive.d.ts +9 -0
- package/alert-dialog/src/alert-dialog-root.directive.d.ts +9 -0
- package/alert-dialog/src/alert-dialog-title.directive.d.ts +5 -0
- package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +7 -0
- package/alert-dialog/src/alert-dialog.service.d.ts +14 -0
- package/avatar/src/avatar-fallback.directive.d.ts +28 -0
- package/avatar/src/avatar-image.directive.d.ts +21 -0
- package/avatar/src/avatar-root.directive.d.ts +21 -0
- package/avatar/src/avatar.config.d.ts +13 -0
- package/checkbox/src/checkbox-button.directive.d.ts +8 -0
- package/checkbox/src/checkbox-indicator.directive.d.ts +6 -0
- package/checkbox/src/checkbox-input.directive.d.ts +9 -0
- package/checkbox/src/checkbox.directive.d.ts +75 -0
- package/checkbox/src/checkbox.token.d.ts +4 -0
- package/collapsible/src/collapsible-content.directive.d.ts +17 -0
- package/collapsible/src/collapsible-content.token.d.ts +3 -0
- package/collapsible/src/collapsible-root.directive.d.ts +55 -0
- package/collapsible/src/collapsible-trigger.directive.d.ts +26 -0
- package/compodoc/documentation.json +14249 -0
- package/context-menu/index.d.ts +26 -0
- package/context-menu/src/context-menu-content.directive.d.ts +15 -0
- package/context-menu/src/context-menu-item-checkbox.directive.d.ts +9 -0
- package/context-menu/src/context-menu-item-indicator.directive.d.ts +7 -0
- package/context-menu/src/context-menu-item-radio-group.directive.d.ts +12 -0
- package/context-menu/src/context-menu-item-radio.directive.d.ts +19 -0
- package/context-menu/src/context-menu-item-selectable.d.ts +12 -0
- package/context-menu/src/context-menu-item.directive.d.ts +17 -0
- package/context-menu/src/context-menu-label.directive.d.ts +5 -0
- package/context-menu/src/context-menu-separator.directive.d.ts +6 -0
- package/context-menu/src/context-menu-trigger.directive.d.ts +31 -0
- package/dialog/index.d.ts +23 -0
- package/dialog/src/dialog-close.directive.d.ts +7 -0
- package/dialog/src/dialog-content.directive.d.ts +21 -0
- package/dialog/src/dialog-description.directive.d.ts +5 -0
- package/dialog/src/dialog-dismiss.directive.d.ts +7 -0
- package/dialog/src/dialog-ref.d.ts +37 -0
- package/dialog/src/dialog-title.directive.d.ts +5 -0
- package/dialog/src/dialog-trigger.directive.d.ts +16 -0
- package/dialog/src/dialog.config.d.ts +39 -0
- package/dialog/src/dialog.injectors.d.ts +4 -0
- package/dialog/src/{dialog.providers.ts → dialog.providers.d.ts} +3 -11
- package/dialog/src/dialog.service.d.ts +26 -0
- package/dropdown-menu/index.d.ts +26 -0
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +15 -0
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +9 -0
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.d.ts +7 -0
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.d.ts +12 -0
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.d.ts +19 -0
- package/dropdown-menu/src/dropdown-menu-item-selectable.d.ts +12 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +17 -0
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +5 -0
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +46 -0
- package/esm2022/accordion/index.mjs +40 -0
- package/esm2022/accordion/radix-ng-primitives-accordion.mjs +5 -0
- package/esm2022/accordion/src/accordion-content.directive.mjs +42 -0
- package/esm2022/accordion/src/accordion-header.directive.mjs +23 -0
- package/esm2022/accordion/src/accordion-item.directive.mjs +187 -0
- package/esm2022/accordion/src/accordion-root.directive.mjs +172 -0
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +42 -0
- package/esm2022/alert-dialog/index.mjs +7 -0
- package/esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs +5 -0
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +34 -0
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +14 -0
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +46 -0
- package/esm2022/avatar/index.mjs +5 -0
- package/esm2022/avatar/radix-ng-primitives-avatar.mjs +5 -0
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +60 -0
- package/esm2022/avatar/src/avatar-image.directive.mjs +52 -0
- package/esm2022/avatar/src/avatar-root.directive.mjs +38 -0
- package/esm2022/avatar/src/avatar.config.mjs +17 -0
- package/esm2022/checkbox/index.mjs +6 -0
- package/esm2022/checkbox/radix-ng-primitives-checkbox.mjs +5 -0
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +33 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +24 -0
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +41 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +141 -0
- package/esm2022/checkbox/src/checkbox.token.mjs +6 -0
- package/esm2022/collapsible/index.mjs +4 -0
- package/esm2022/collapsible/radix-ng-primitives-collapsible.mjs +5 -0
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +45 -0
- package/esm2022/collapsible/src/collapsible-content.token.mjs +3 -0
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +118 -0
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +49 -0
- package/esm2022/context-menu/index.mjs +65 -0
- package/esm2022/context-menu/radix-ng-primitives-context-menu.mjs +5 -0
- package/esm2022/context-menu/src/context-menu-content.directive.mjs +56 -0
- package/esm2022/context-menu/src/context-menu-item-checkbox.directive.mjs +39 -0
- package/esm2022/context-menu/src/context-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/context-menu/src/context-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/context-menu/src/context-menu-item-radio.directive.mjs +67 -0
- package/esm2022/context-menu/src/context-menu-item-selectable.mjs +31 -0
- package/esm2022/context-menu/src/context-menu-item.directive.mjs +70 -0
- package/esm2022/context-menu/src/context-menu-label.directive.mjs +14 -0
- package/esm2022/context-menu/src/context-menu-separator.directive.mjs +21 -0
- package/esm2022/context-menu/src/context-menu-trigger.directive.mjs +92 -0
- package/esm2022/dialog/index.mjs +50 -0
- package/esm2022/dialog/radix-ng-primitives-dialog.mjs +5 -0
- package/esm2022/dialog/src/dialog-close.directive.mjs +25 -0
- package/esm2022/dialog/src/dialog-content.directive.mjs +46 -0
- package/esm2022/dialog/src/dialog-description.directive.mjs +14 -0
- package/esm2022/dialog/src/dialog-dismiss.directive.mjs +25 -0
- package/esm2022/dialog/src/dialog-ref.mjs +46 -0
- package/esm2022/dialog/src/dialog-title.directive.mjs +14 -0
- package/esm2022/dialog/src/dialog-trigger.directive.mjs +54 -0
- package/esm2022/dialog/src/dialog.config.mjs +6 -0
- package/esm2022/dialog/src/dialog.injectors.mjs +10 -0
- package/esm2022/dialog/src/dialog.providers.mjs +26 -0
- package/esm2022/dialog/src/dialog.service.mjs +96 -0
- package/esm2022/dropdown-menu/index.mjs +68 -0
- package/esm2022/dropdown-menu/radix-ng-primitives-dropdown-menu.mjs +5 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +56 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +39 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio.directive.mjs +67 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +31 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +71 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +14 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +21 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +179 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/label/index.mjs +2 -0
- package/esm2022/label/radix-ng-primitives-label.mjs +5 -0
- package/esm2022/label/src/label.directive.mjs +59 -0
- package/esm2022/menu/index.mjs +45 -0
- package/esm2022/menu/radix-ng-primitives-menu.mjs +5 -0
- package/esm2022/menu/src/menu-content.directive.mjs +17 -0
- package/esm2022/menu/src/menu-directive.mjs +18 -0
- package/esm2022/menu/src/menu-group.directive.mjs +20 -0
- package/esm2022/menu/src/menu-item.directive.mjs +46 -0
- package/esm2022/menu/src/menu-label.directive.mjs +14 -0
- package/esm2022/menu/src/menu-separator.directive.mjs +21 -0
- package/esm2022/menubar/index.mjs +60 -0
- package/esm2022/menubar/radix-ng-primitives-menubar.mjs +5 -0
- package/esm2022/menubar/src/menubar-content.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +34 -0
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +35 -0
- package/esm2022/menubar/src/menubar-item.directive.mjs +20 -0
- package/esm2022/menubar/src/menubar-radio-group.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-root.directive.mjs +24 -0
- package/esm2022/menubar/src/menubar-separator.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +45 -0
- package/esm2022/progress/index.mjs +25 -0
- package/esm2022/progress/radix-ng-primitives-progress.mjs +5 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +34 -0
- package/esm2022/progress/src/progress-root.directive.mjs +127 -0
- package/esm2022/radio/index.mjs +4 -0
- package/esm2022/radio/radix-ng-primitives-radio.mjs +5 -0
- package/esm2022/radio/src/radio-indicator.directive.mjs +25 -0
- package/esm2022/radio/src/radio-item.directive.mjs +70 -0
- package/esm2022/radio/src/radio-root.directive.mjs +194 -0
- package/esm2022/radio/src/radio-tokens.mjs +3 -0
- package/esm2022/radix-ng-primitives.mjs +5 -0
- package/esm2022/separator/index.mjs +2 -0
- package/esm2022/separator/radix-ng-primitives-separator.mjs +5 -0
- package/esm2022/separator/src/separator.directive.mjs +32 -0
- package/esm2022/switch/index.mjs +30 -0
- package/esm2022/switch/radix-ng-primitives-switch.mjs +5 -0
- package/esm2022/switch/src/switch-input.directive.mjs +32 -0
- package/esm2022/switch/src/switch-root.directive.mjs +95 -0
- package/esm2022/switch/src/switch-thumb.directive.mjs +23 -0
- package/esm2022/tabs/index.mjs +38 -0
- package/esm2022/tabs/radix-ng-primitives-tabs.mjs +5 -0
- package/esm2022/tabs/src/tabs-content.directive.mjs +29 -0
- package/esm2022/tabs/src/tabs-context.service.mjs +43 -0
- package/esm2022/tabs/src/tabs-list.directive.mjs +23 -0
- package/esm2022/tabs/src/tabs-root.directive.mjs +54 -0
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +52 -0
- package/esm2022/toggle/index.mjs +2 -0
- package/esm2022/toggle/radix-ng-primitives-toggle.mjs +5 -0
- package/esm2022/toggle/src/toggle.directive.mjs +39 -0
- package/esm2022/toggle-group/index.mjs +6 -0
- package/esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs +5 -0
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +75 -0
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +6 -0
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +143 -0
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +134 -0
- package/esm2022/toggle-group/src/toggle-group.token.mjs +6 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +483 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +159 -0
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs +166 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +241 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-collapsible.mjs +213 -0
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs +463 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs +373 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +555 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +66 -0
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-menu.mjs +158 -0
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-menubar.mjs +245 -0
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +184 -0
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-radio.mjs +289 -0
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +39 -0
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-switch.mjs +173 -0
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs +222 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +358 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs +46 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives.mjs +4 -0
- package/fesm2022/radix-ng-primitives.mjs.map +1 -0
- package/label/src/label.directive.d.ts +29 -0
- package/menu/index.d.ts +18 -0
- package/menu/src/menu-content.directive.d.ts +6 -0
- package/menu/src/menu-directive.d.ts +6 -0
- package/menu/src/menu-group.directive.d.ts +6 -0
- package/menu/src/menu-item.directive.d.ts +12 -0
- package/menu/src/menu-label.directive.d.ts +5 -0
- package/menu/src/menu-separator.directive.d.ts +6 -0
- package/menubar/index.d.ts +24 -0
- package/menubar/src/menubar-content.directive.d.ts +6 -0
- package/menubar/src/menubar-item-checkbox.directive.d.ts +14 -0
- package/menubar/src/menubar-item-indicator.directive.d.ts +5 -0
- package/menubar/src/menubar-item-radio.directive.d.ts +14 -0
- package/menubar/src/menubar-item.directive.d.ts +8 -0
- package/menubar/src/menubar-radio-group.directive.d.ts +6 -0
- package/menubar/src/menubar-root.directive.d.ts +7 -0
- package/menubar/src/menubar-separator.directive.d.ts +6 -0
- package/menubar/src/menubar-trigger.directive.d.ts +11 -0
- package/package.json +124 -4
- package/progress/index.d.ts +11 -0
- package/progress/src/progress-indicator.directive.d.ts +16 -0
- package/progress/src/progress-root.directive.d.ts +63 -0
- package/radio/{index.ts → index.d.ts} +0 -1
- package/radio/src/radio-indicator.directive.d.ts +9 -0
- package/radio/src/radio-item.directive.d.ts +21 -0
- package/radio/src/radio-root.directive.d.ts +72 -0
- package/radio/src/{radio-tokens.ts → radio-tokens.d.ts} +1 -5
- package/separator/src/separator.directive.d.ts +22 -0
- package/switch/index.d.ts +13 -0
- package/switch/src/switch-input.directive.d.ts +6 -0
- package/switch/src/switch-root.directive.d.ts +51 -0
- package/switch/src/switch-thumb.directive.d.ts +6 -0
- package/tabs/index.d.ts +15 -0
- package/tabs/src/tabs-content.directive.d.ts +8 -0
- package/tabs/src/tabs-context.service.d.ts +22 -0
- package/tabs/src/tabs-list.directive.d.ts +6 -0
- package/tabs/src/tabs-root.directive.d.ts +37 -0
- package/tabs/src/tabs-trigger.directive.d.ts +19 -0
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/toggle-group/src/toggle-group-button.directive.d.ts +39 -0
- package/toggle-group/src/toggle-group-button.token.d.ts +4 -0
- package/toggle-group/src/toggle-group-multi.directive.d.ts +93 -0
- package/toggle-group/src/toggle-group.directive.d.ts +84 -0
- package/toggle-group/src/toggle-group.token.d.ts +5 -0
- package/.compodocrc.json +0 -12
- package/CHANGELOG.md +0 -189
- package/accordion/__tests__/accordion-content.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-header.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-item.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-root.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-trigger.directive.spec.ts +0 -8
- package/accordion/index.ts +0 -5
- package/accordion/ng-package.json +0 -5
- package/accordion/src/accordion-content.directive.ts +0 -46
- package/accordion/src/accordion-header.directive.ts +0 -15
- package/accordion/src/accordion-item.directive.ts +0 -216
- package/accordion/src/accordion-root.directive.ts +0 -205
- package/accordion/src/accordion-trigger.directive.ts +0 -37
- package/accordion/stories/accordion.docs.mdx +0 -77
- package/accordion/stories/accordion.stories.ts +0 -340
- package/alert-dialog/ng-package.json +0 -5
- package/alert-dialog/src/alert-dialog-cancel.directive.ts +0 -17
- package/alert-dialog/src/alert-dialog-content.directive.ts +0 -24
- package/alert-dialog/src/alert-dialog-root.directive.ts +0 -15
- package/alert-dialog/src/alert-dialog-title.directive.ts +0 -7
- package/alert-dialog/src/alert-dialog-trigger.directive.ts +0 -17
- package/alert-dialog/src/alert-dialog.service.ts +0 -51
- package/alert-dialog/stories/alert-dialog.stories.ts +0 -139
- package/avatar/__tests__/avatar-fallback.directive.spec.ts +0 -31
- package/avatar/__tests__/avatar-image.directive.spec.ts +0 -36
- package/avatar/ng-package.json +0 -5
- package/avatar/src/avatar-fallback.directive.ts +0 -62
- package/avatar/src/avatar-image.directive.ts +0 -55
- package/avatar/src/avatar-root.directive.ts +0 -35
- package/avatar/src/avatar.config.ts +0 -29
- package/avatar/stories/avatar.docs.mdx +0 -37
- package/avatar/stories/avatar.stories.ts +0 -87
- package/button/__tests__/.gitkeep +0 -0
- package/button/src/button-abstract.directive.ts +0 -46
- package/checkbox/ng-package.json +0 -5
- package/checkbox/src/checkbox-button.directive.ts +0 -26
- package/checkbox/src/checkbox-indicator.directive.ts +0 -16
- package/checkbox/src/checkbox-input.directive.ts +0 -36
- package/checkbox/src/checkbox.directive.ts +0 -146
- package/checkbox/src/checkbox.token.ts +0 -8
- package/checkbox/stories/checkbox-group.component.ts +0 -87
- package/checkbox/stories/checkbox-group.styles.scss +0 -49
- package/checkbox/stories/checkbox-indeterminate.component.ts +0 -52
- package/checkbox/stories/checkbox.docs.mdx +0 -58
- package/checkbox/stories/checkbox.stories.ts +0 -105
- package/collapsible/__tests__/collapsible-content.directive.spec.ts +0 -30
- package/collapsible/__tests__/collapsible-root.directive.spec.ts +0 -27
- package/collapsible/__tests__/collapsible-trigger.directive.spec.ts +0 -30
- package/collapsible/ng-package.json +0 -5
- package/collapsible/src/collapsible-content.directive.ts +0 -34
- package/collapsible/src/collapsible-content.token.ts +0 -6
- package/collapsible/src/collapsible-root.directive.ts +0 -120
- package/collapsible/src/collapsible-trigger.directive.ts +0 -44
- package/collapsible/stories/collapsible-animation.component.ts +0 -116
- package/collapsible/stories/collapsible-external-triggering.component.ts +0 -86
- package/collapsible/stories/collapsible.docs.mdx +0 -53
- package/collapsible/stories/collapsible.stories.ts +0 -151
- package/context-menu/index.ts +0 -10
- package/context-menu/ng-package.json +0 -5
- package/context-menu/src/context-menu-content.directive.ts +0 -47
- package/context-menu/src/context-menu-item-checkbox.directive.ts +0 -30
- package/context-menu/src/context-menu-item-indicator.directive.ts +0 -14
- package/context-menu/src/context-menu-item-radio-group.directive.ts +0 -31
- package/context-menu/src/context-menu-item-radio.directive.ts +0 -69
- package/context-menu/src/context-menu-item-selectable.ts +0 -18
- package/context-menu/src/context-menu-item.directive.ts +0 -65
- package/context-menu/src/context-menu-label.directive.ts +0 -7
- package/context-menu/src/context-menu-separator.directive.ts +0 -13
- package/context-menu/src/context-menu-trigger.directive.ts +0 -82
- package/context-menu/stories/context-menu.docs.mdx +0 -23
- package/context-menu/stories/context-menu.stories.ts +0 -253
- package/core/index.ts +0 -3
- package/core/src/accessor/provide-value-accessor.ts +0 -20
- package/core/src/auto-focus.directive.ts +0 -81
- package/core/src/inject-ng-control.ts +0 -28
- package/core/src/mount.ts +0 -27
- package/dialog/__tests__/dialog-content.directive.spec.ts +0 -77
- package/dialog/__tests__/dialog-trigger.directive.spec.ts +0 -85
- package/dialog/index.ts +0 -31
- package/dialog/ng-package.json +0 -5
- package/dialog/src/dialog-close.directive.ts +0 -18
- package/dialog/src/dialog-content.directive.ts +0 -45
- package/dialog/src/dialog-description.directive.ts +0 -7
- package/dialog/src/dialog-dismiss.directive.ts +0 -18
- package/dialog/src/dialog-ref.ts +0 -70
- package/dialog/src/dialog-title.directive.ts +0 -7
- package/dialog/src/dialog-trigger.directive.ts +0 -52
- package/dialog/src/dialog.config.ts +0 -55
- package/dialog/src/dialog.injectors.ts +0 -12
- package/dialog/src/dialog.service.ts +0 -94
- package/dialog/stories/dialog.docs.mdx +0 -32
- package/dialog/stories/dialog.stories.ts +0 -233
- package/dropdown-menu/index.ts +0 -10
- package/dropdown-menu/ng-package.json +0 -5
- package/dropdown-menu/src/dropdown-menu-content.directive.ts +0 -47
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.ts +0 -30
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.ts +0 -14
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.ts +0 -31
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.ts +0 -72
- package/dropdown-menu/src/dropdown-menu-item-selectable.ts +0 -18
- package/dropdown-menu/src/dropdown-menu-item.directive.ts +0 -66
- package/dropdown-menu/src/dropdown-menu-label.directive.ts +0 -7
- package/dropdown-menu/src/dropdown-menu-separator.directive.ts +0 -13
- package/dropdown-menu/src/dropdown-menu-trigger.directive.ts +0 -185
- package/dropdown-menu/stories/dropdown-menu-item-checkbox.component.ts +0 -104
- package/dropdown-menu/stories/dropdown-menu-item-checkbox.styles.scss +0 -106
- package/dropdown-menu/stories/dropdown-menu-item-radio.component.ts +0 -95
- package/dropdown-menu/stories/dropdown-menu-item-radio.styles.scss +0 -106
- package/dropdown-menu/stories/dropdown.docs.mdx +0 -27
- package/dropdown-menu/stories/dropdown.stories.ts +0 -212
- package/form-field/index.ts +0 -1
- package/form-field/src/.gitkeep +0 -0
- package/jest.config.ts +0 -21
- package/label/__tests__/label-root.directive.spec.ts +0 -99
- package/label/ng-package.json +0 -5
- package/label/src/label.directive.ts +0 -58
- package/label/stories/label.docs.mdx +0 -40
- package/label/stories/label.stories.ts +0 -76
- package/menu/index.ts +0 -29
- package/menu/ng-package.json +0 -5
- package/menu/src/menu-content.directive.ts +0 -9
- package/menu/src/menu-directive.ts +0 -10
- package/menu/src/menu-group.directive.ts +0 -12
- package/menu/src/menu-item.directive.ts +0 -44
- package/menu/src/menu-label.directive.ts +0 -7
- package/menu/src/menu-separator.directive.ts +0 -13
- package/menubar/index.ts +0 -38
- package/menubar/ng-package.json +0 -5
- package/menubar/src/menubar-content.directive.ts +0 -9
- package/menubar/src/menubar-item-checkbox.directive.ts +0 -32
- package/menubar/src/menubar-item-indicator.directive.ts +0 -10
- package/menubar/src/menubar-item-radio.directive.ts +0 -33
- package/menubar/src/menubar-item.directive.ts +0 -12
- package/menubar/src/menubar-radio-group.directive.ts +0 -9
- package/menubar/src/menubar-root.directive.ts +0 -15
- package/menubar/src/menubar-separator.directive.ts +0 -9
- package/menubar/src/menubar-trigger.directive.ts +0 -40
- package/menubar/stories/menubar.stories.ts +0 -229
- package/ng-package.json +0 -8
- package/portal/stories/portal.docs.mdx +0 -85
- package/presence/__test__/presence-test.component.ts +0 -51
- package/presence/__test__/presence.spec.ts +0 -50
- package/presence/index.ts +0 -4
- package/presence/src/presence.ts +0 -119
- package/presence/src/transitions/transition.collapse.ts +0 -99
- package/presence/src/transitions/transition.toast.ts +0 -27
- package/presence/src/types.ts +0 -20
- package/presence/src/utils.ts +0 -63
- package/presence/stories/presence-story.componen.ts +0 -69
- package/presence/stories/presence.docs.mdx +0 -40
- package/presence/stories/presence.stories.ts +0 -29
- package/progress/__test__/progress.spec.ts +0 -55
- package/progress/index.ts +0 -4
- package/progress/ng-package.json +0 -5
- package/progress/src/progress-indicator.directive.ts +0 -26
- package/progress/src/progress-root.directive.ts +0 -134
- package/progress/stories/progress.docs.mdx +0 -65
- package/progress/stories/progress.stories.ts +0 -66
- package/project.json +0 -39
- package/radio/ng-package.json +0 -5
- package/radio/src/radio-indicator.directive.ts +0 -17
- package/radio/src/radio-item.directive.ts +0 -68
- package/radio/src/radio-root.directive.ts +0 -207
- package/radio/stories/radio-group.component.ts +0 -39
- package/radio/stories/radio-group.styles.scss +0 -70
- package/radio/stories/radio.docs.mdx +0 -68
- package/radio/stories/radio.stories.ts +0 -155
- package/separator/__tests__/separator.directive.spec.ts +0 -58
- package/separator/ng-package.json +0 -5
- package/separator/src/separator.directive.ts +0 -35
- package/separator/stories/separator.docs.mdx +0 -37
- package/separator/stories/separator.stories.ts +0 -82
- package/slider/src/slider-input.directive.ts +0 -0
- package/slider/src/slider-thumb.directives.ts +0 -60
- package/slider/src/slider-track.directive.ts +0 -11
- package/slider/src/slider.directive.ts +0 -59
- package/slider/src/slider.types.ts +0 -4
- package/switch/index.ts +0 -22
- package/switch/ng-package.json +0 -5
- package/switch/src/switch-input.directive.ts +0 -24
- package/switch/src/switch-root.directive.ts +0 -127
- package/switch/src/switch-thumb.directive.ts +0 -15
- package/switch/stories/switch.docs.mdx +0 -83
- package/switch/stories/switch.stories.ts +0 -149
- package/tabs/__tests__/tabs-context.service.spec.ts +0 -35
- package/tabs/index.ts +0 -26
- package/tabs/ng-package.json +0 -5
- package/tabs/src/tabs-content.directive.ts +0 -23
- package/tabs/src/tabs-context.service.ts +0 -43
- package/tabs/src/tabs-list.directive.ts +0 -21
- package/tabs/src/tabs-root.directive.ts +0 -70
- package/tabs/src/tabs-trigger.directive.ts +0 -55
- package/tabs/stories/tabs.stories.ts +0 -213
- package/test-setup.ts +0 -1
- package/toggle/__tests__/toggle.directive.spec.ts +0 -87
- package/toggle/ng-package.json +0 -5
- package/toggle/src/toggle.directive.ts +0 -49
- package/toggle/stories/toggle.docs.mdx +0 -60
- package/toggle/stories/toggle.stories.ts +0 -84
- package/toggle-group/ng-package.json +0 -5
- package/toggle-group/src/toggle-group-button.directive.ts +0 -73
- package/toggle-group/src/toggle-group-button.token.ts +0 -8
- package/toggle-group/src/toggle-group-multi.directive.ts +0 -158
- package/toggle-group/src/toggle-group.directive.ts +0 -148
- package/toggle-group/src/toggle-group.token.ts +0 -11
- package/toggle-group/stories/toggle-group.docs.mdx +0 -87
- package/toggle-group/stories/toggle-group.stories.ts +0 -95
- package/tsconfig.doc.json +0 -11
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -12
- package/tsconfig.spec.json +0 -11
- package/visually-hidden/README.md +0 -3
- package/visually-hidden/stories/visually-hidden.docs.mdx +0 -36
- /package/avatar/{index.ts → index.d.ts} +0 -0
- /package/checkbox/{index.ts → index.d.ts} +0 -0
- /package/collapsible/{index.ts → index.d.ts} +0 -0
- /package/{index.ts → index.d.ts} +0 -0
- /package/label/{index.ts → index.d.ts} +0 -0
- /package/separator/{index.ts → index.d.ts} +0 -0
- /package/toggle/{index.ts → index.d.ts} +0 -0
- /package/toggle-group/{index.ts → index.d.ts} +0 -0
@@ -1,87 +0,0 @@
|
|
1
|
-
import { JsonPipe } from '@angular/common';
|
2
|
-
import { Component } from '@angular/core';
|
3
|
-
import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
4
|
-
import { RdxLabelDirective } from '@radix-ng/primitives/label';
|
5
|
-
import { LucideAngularModule } from 'lucide-angular';
|
6
|
-
import { RdxCheckboxIndicatorDirective } from '../src/checkbox-indicator.directive';
|
7
|
-
import { RdxCheckboxInputDirective } from '../src/checkbox-input.directive';
|
8
|
-
import { RdxCheckboxDirective } from '../src/checkbox.directive';
|
9
|
-
|
10
|
-
@Component({
|
11
|
-
selector: 'checkbox-groups-forms-example',
|
12
|
-
template: `
|
13
|
-
<section [formGroup]="personality">
|
14
|
-
<p>
|
15
|
-
<label class="Label" rdxLabel htmlFor="r1">
|
16
|
-
<button class="CheckboxRoot" CheckboxRoot formControlName="fun">
|
17
|
-
<lucide-angular class="CheckboxIndicator" CheckboxIndicator size="16" name="check" />
|
18
|
-
<input class="Input cdk-visually-hidden" id="r1" CheckboxInput />
|
19
|
-
</button>
|
20
|
-
Fun
|
21
|
-
</label>
|
22
|
-
</p>
|
23
|
-
<p>
|
24
|
-
<label class="Label" rdxLabel htmlFor="r2">
|
25
|
-
<button
|
26
|
-
class="CheckboxRoot rt-BaseCheckboxRoot rt-CheckboxRoot"
|
27
|
-
CheckboxRoot
|
28
|
-
formControlName="serious"
|
29
|
-
>
|
30
|
-
<lucide-angular class="CheckboxIndicator" CheckboxIndicator size="16" name="check" />
|
31
|
-
<input class="Input cdk-visually-hidden" id="r2" CheckboxInput />
|
32
|
-
</button>
|
33
|
-
Serious
|
34
|
-
</label>
|
35
|
-
</p>
|
36
|
-
<p>
|
37
|
-
<label class="Label" rdxLabel htmlFor="r3">
|
38
|
-
<button class="CheckboxRoot" CheckboxRoot formControlName="smart">
|
39
|
-
<lucide-angular class="CheckboxIndicator" CheckboxIndicator size="16" name="check" />
|
40
|
-
<input class="Input cdk-visually-hidden" id="r3" CheckboxInput />
|
41
|
-
</button>
|
42
|
-
Smart
|
43
|
-
</label>
|
44
|
-
</p>
|
45
|
-
</section>
|
46
|
-
<section class="Label" [formGroup]="personality">
|
47
|
-
<h4>You chose: </h4>
|
48
|
-
{{ personality.value | json }}
|
49
|
-
</section>
|
50
|
-
|
51
|
-
<button
|
52
|
-
class="rt-reset rt-BaseButton rt-r-size-2 rt-variant-solid rt-Button"
|
53
|
-
(click)="toggleDisable()"
|
54
|
-
data-accent-color="cyan"
|
55
|
-
>
|
56
|
-
Toggle disabled state
|
57
|
-
</button>
|
58
|
-
`,
|
59
|
-
styleUrl: 'checkbox-group.styles.scss',
|
60
|
-
standalone: true,
|
61
|
-
imports: [
|
62
|
-
FormsModule,
|
63
|
-
ReactiveFormsModule,
|
64
|
-
JsonPipe,
|
65
|
-
RdxLabelDirective,
|
66
|
-
RdxCheckboxDirective,
|
67
|
-
RdxCheckboxIndicatorDirective,
|
68
|
-
LucideAngularModule,
|
69
|
-
RdxCheckboxInputDirective
|
70
|
-
]
|
71
|
-
})
|
72
|
-
export class CheckboxReactiveFormsExampleComponent {
|
73
|
-
personality = this.formBuilder.group({
|
74
|
-
fun: false,
|
75
|
-
serious: false,
|
76
|
-
smart: false
|
77
|
-
});
|
78
|
-
|
79
|
-
constructor(protected formBuilder: FormBuilder) {}
|
80
|
-
|
81
|
-
toggleDisable() {
|
82
|
-
const checkbox = this.personality.get('serious');
|
83
|
-
if (checkbox != null) {
|
84
|
-
checkbox.disabled ? checkbox.enable() : checkbox.disable();
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
.Input {
|
2
|
-
transform: translateX(-100%);
|
3
|
-
position: absolute;
|
4
|
-
pointer-events: none;
|
5
|
-
opacity: 0;
|
6
|
-
margin: 0;
|
7
|
-
width: 25px;
|
8
|
-
height: 25px;
|
9
|
-
}
|
10
|
-
|
11
|
-
.CheckboxRoot {
|
12
|
-
all: unset;
|
13
|
-
background-color: white;
|
14
|
-
width: 25px;
|
15
|
-
height: 25px;
|
16
|
-
margin-right: 15px;
|
17
|
-
border-radius: 4px;
|
18
|
-
display: flex;
|
19
|
-
align-items: center;
|
20
|
-
justify-content: center;
|
21
|
-
box-shadow: 0 2px 10px var(--black-a7);
|
22
|
-
|
23
|
-
&:where(:disabled) {
|
24
|
-
cursor: var(--cursor-disabled);
|
25
|
-
background-color: var(--gray-5);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
.CheckboxRoot:focus {
|
30
|
-
box-shadow: 0 0 0 2px black;
|
31
|
-
}
|
32
|
-
|
33
|
-
.CheckboxIndicator {
|
34
|
-
align-items: center;
|
35
|
-
display: flex;
|
36
|
-
color: var(--violet-11);
|
37
|
-
}
|
38
|
-
|
39
|
-
.CheckboxIndicator[data-state='unchecked'] {
|
40
|
-
display: none;
|
41
|
-
}
|
42
|
-
|
43
|
-
.Label {
|
44
|
-
color: white;
|
45
|
-
font-size: 15px;
|
46
|
-
line-height: 1;
|
47
|
-
display: flex;
|
48
|
-
align-items: center;
|
49
|
-
}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
import { Component, model } from '@angular/core';
|
2
|
-
import { FormsModule } from '@angular/forms';
|
3
|
-
import { RdxLabelDirective } from '@radix-ng/primitives/label';
|
4
|
-
import { LucideAngularModule } from 'lucide-angular';
|
5
|
-
import { RdxCheckboxIndicatorDirective } from '../src/checkbox-indicator.directive';
|
6
|
-
import { RdxCheckboxInputDirective } from '../src/checkbox-input.directive';
|
7
|
-
import { RdxCheckboxDirective } from '../src/checkbox.directive';
|
8
|
-
|
9
|
-
@Component({
|
10
|
-
selector: 'checkbox-indeterminate-example',
|
11
|
-
template: `
|
12
|
-
<label class="Label" rdxLabel htmlFor="r1">
|
13
|
-
<button class="CheckboxRoot" [(indeterminate)]="indeterminate" [(ngModel)]="checked" CheckboxRoot>
|
14
|
-
<lucide-angular class="CheckboxIndicator" [name]="iconName()" CheckboxIndicator size="16" />
|
15
|
-
<input class="Input" id="r1" CheckboxInput />
|
16
|
-
</button>
|
17
|
-
I'm a checkbox
|
18
|
-
</label>
|
19
|
-
|
20
|
-
<p>
|
21
|
-
<button
|
22
|
-
class="rt-reset rt-BaseButton rt-r-size-2 rt-variant-solid rt-Button"
|
23
|
-
(click)="toggleIndeterminate()"
|
24
|
-
data-accent-color="cyan"
|
25
|
-
>
|
26
|
-
Toggle Indeterminate state
|
27
|
-
</button>
|
28
|
-
</p>
|
29
|
-
`,
|
30
|
-
styleUrl: 'checkbox-group.styles.scss',
|
31
|
-
standalone: true,
|
32
|
-
imports: [
|
33
|
-
FormsModule,
|
34
|
-
RdxLabelDirective,
|
35
|
-
RdxCheckboxDirective,
|
36
|
-
RdxCheckboxIndicatorDirective,
|
37
|
-
LucideAngularModule,
|
38
|
-
RdxCheckboxInputDirective
|
39
|
-
]
|
40
|
-
})
|
41
|
-
export class CheckboxIndeterminateComponent {
|
42
|
-
readonly indeterminate = model(false);
|
43
|
-
readonly checked = model(false);
|
44
|
-
|
45
|
-
readonly iconName = model('check');
|
46
|
-
|
47
|
-
toggleIndeterminate() {
|
48
|
-
this.indeterminate.set(!this.indeterminate());
|
49
|
-
|
50
|
-
this.iconName() === 'check' ? this.iconName.set('minus') : this.iconName.set('check');
|
51
|
-
}
|
52
|
-
}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import { ArgTypes, Canvas, Markdown, Meta } from '@storybook/blocks';
|
2
|
-
import { RdxCheckboxDirective } from '../src/checkbox.directive';
|
3
|
-
import * as CheckboxDirectiveStories from './checkbox.stories';
|
4
|
-
|
5
|
-
<Meta title="Primitives/Checkbox" />
|
6
|
-
|
7
|
-
# Checkbox
|
8
|
-
|
9
|
-
#### A control that allows the user to toggle between checked and not checked.
|
10
|
-
|
11
|
-
<Canvas sourceState="hidden" of={CheckboxDirectiveStories.Default} />
|
12
|
-
|
13
|
-
## Features
|
14
|
-
|
15
|
-
- ✅ Full keyboard navigation.
|
16
|
-
- ✅ Supports indeterminate \_state.
|
17
|
-
- ✅ Can be controlled or uncontrolled.
|
18
|
-
|
19
|
-
## Import
|
20
|
-
|
21
|
-
Get started with importing the directives:
|
22
|
-
|
23
|
-
```typescript
|
24
|
-
import { RdxCheckboxDirective, RdxCheckboxIndicatorDirective } from '@radix-ng/primitives/checkbox';
|
25
|
-
```
|
26
|
-
|
27
|
-
## Anatomy
|
28
|
-
|
29
|
-
```html
|
30
|
-
<button CheckboxRoot [(checked)]="checked">
|
31
|
-
<lucide-angular CheckboxIndicator name="check"></lucide-angular>
|
32
|
-
<input class="cdk-visually-hidden" CheckboxInput type="checkbox" />
|
33
|
-
</button>
|
34
|
-
```
|
35
|
-
|
36
|
-
## API Reference
|
37
|
-
|
38
|
-
### RdxCheckboxDirective
|
39
|
-
|
40
|
-
<ArgTypes of={RdxCheckboxDirective} />
|
41
|
-
|
42
|
-
### RdxCheckboxIndicatorDirective
|
43
|
-
|
44
|
-
### RdxRadioIndicatorDirective
|
45
|
-
|
46
|
-
## Accessibility
|
47
|
-
|
48
|
-
Adheres to the [tri-\_state Checkbox WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox).
|
49
|
-
|
50
|
-
### Keyboard Interactions
|
51
|
-
|
52
|
-
<Markdown>
|
53
|
-
{`
|
54
|
-
| Key | Description |
|
55
|
-
| ----------- | --------- |
|
56
|
-
| Space | Checks/unchecks the checkbox. |
|
57
|
-
`}
|
58
|
-
</Markdown>
|
@@ -1,105 +0,0 @@
|
|
1
|
-
import { componentWrapperDecorator, Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
2
|
-
import { Check, LucideAngularModule, Minus } from 'lucide-angular';
|
3
|
-
import { RdxLabelDirective } from '../../label';
|
4
|
-
import { RdxCheckboxIndicatorDirective } from '../src/checkbox-indicator.directive';
|
5
|
-
import { RdxCheckboxInputDirective } from '../src/checkbox-input.directive';
|
6
|
-
import { RdxCheckboxDirective } from '../src/checkbox.directive';
|
7
|
-
import { CheckboxReactiveFormsExampleComponent } from './checkbox-group.component';
|
8
|
-
import { CheckboxIndeterminateComponent } from './checkbox-indeterminate.component';
|
9
|
-
|
10
|
-
export default {
|
11
|
-
title: 'Primitives/Checkbox',
|
12
|
-
decorators: [
|
13
|
-
moduleMetadata({
|
14
|
-
imports: [
|
15
|
-
RdxLabelDirective,
|
16
|
-
RdxCheckboxDirective,
|
17
|
-
RdxCheckboxIndicatorDirective,
|
18
|
-
RdxCheckboxInputDirective,
|
19
|
-
LucideAngularModule,
|
20
|
-
LucideAngularModule.pick({ Check, Minus }),
|
21
|
-
CheckboxReactiveFormsExampleComponent,
|
22
|
-
CheckboxIndeterminateComponent
|
23
|
-
]
|
24
|
-
}),
|
25
|
-
componentWrapperDecorator(
|
26
|
-
(story) =>
|
27
|
-
`<div class="radix-themes light light-theme radix-themes-default-fonts"
|
28
|
-
data-accent-color="indigo"
|
29
|
-
data-gray-color="slate"
|
30
|
-
data-radius="medium"
|
31
|
-
data-scaling="100%">${story}</div>`
|
32
|
-
)
|
33
|
-
]
|
34
|
-
} as Meta;
|
35
|
-
|
36
|
-
type Story = StoryObj;
|
37
|
-
|
38
|
-
export const Default: Story = {
|
39
|
-
render: () => ({
|
40
|
-
template: `
|
41
|
-
<form>
|
42
|
-
<div style="display: flex; align-items: center;">
|
43
|
-
<button CheckboxRoot class="CheckboxRoot" id="r1" [(checked)]="checked">
|
44
|
-
<lucide-angular CheckboxIndicator class="CheckboxIndicator" size="16" name="check"></lucide-angular>
|
45
|
-
<input CheckboxInput type="checkbox" class="cdk-visually-hidden"/>
|
46
|
-
</button>
|
47
|
-
<label rdxLabel htmlFor="r1" class="Label">Check Item</label>
|
48
|
-
</div>
|
49
|
-
</form>
|
50
|
-
|
51
|
-
<style>
|
52
|
-
button {
|
53
|
-
all: unset;
|
54
|
-
}
|
55
|
-
|
56
|
-
.CheckboxRoot {
|
57
|
-
background-color: white;
|
58
|
-
width: 25px;
|
59
|
-
height: 25px;
|
60
|
-
border-radius: 4px;
|
61
|
-
display: flex;
|
62
|
-
align-items: center;
|
63
|
-
justify-content: center;
|
64
|
-
box-shadow: 0 2px 10px var(--black-a7);
|
65
|
-
}
|
66
|
-
.CheckboxRoot:hover {
|
67
|
-
background-color: var(--violet-3);
|
68
|
-
}
|
69
|
-
.CheckboxRoot:focus {
|
70
|
-
box-shadow: 0 0 0 2px black;
|
71
|
-
}
|
72
|
-
|
73
|
-
.CheckboxIndicator {
|
74
|
-
align-items: center;
|
75
|
-
display: flex;
|
76
|
-
color: var(--violet-11);
|
77
|
-
}
|
78
|
-
|
79
|
-
.CheckboxIndicator[data-state='unchecked'] {
|
80
|
-
display: none;
|
81
|
-
}
|
82
|
-
|
83
|
-
.Label {
|
84
|
-
color: white;
|
85
|
-
padding-left: 15px;
|
86
|
-
font-size: 15px;
|
87
|
-
line-height: 1;
|
88
|
-
}
|
89
|
-
</style>
|
90
|
-
`
|
91
|
-
})
|
92
|
-
};
|
93
|
-
|
94
|
-
export const CheckboxGroup: Story = {
|
95
|
-
name: 'With Reactive forms',
|
96
|
-
render: () => ({
|
97
|
-
template: `<checkbox-groups-forms-example></checkbox-groups-forms-example>`
|
98
|
-
})
|
99
|
-
};
|
100
|
-
|
101
|
-
export const indeterminate: Story = {
|
102
|
-
render: () => ({
|
103
|
-
template: `<checkbox-indeterminate-example></checkbox-indeterminate-example>`
|
104
|
-
})
|
105
|
-
};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { Component } from '@angular/core';
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
3
|
-
import { RdxCollapsibleContentDirective } from '../src/collapsible-content.directive';
|
4
|
-
import { RdxCollapsibleRootDirective } from '../src/collapsible-root.directive';
|
5
|
-
|
6
|
-
@Component({
|
7
|
-
selector: 'rdx-collapsible-mock-trigger',
|
8
|
-
standalone: true,
|
9
|
-
imports: [RdxCollapsibleRootDirective, RdxCollapsibleContentDirective],
|
10
|
-
template: `
|
11
|
-
<div CollapsibleRoot>
|
12
|
-
<div CollapsibleContent>Content</div>
|
13
|
-
</div>
|
14
|
-
`
|
15
|
-
})
|
16
|
-
class RdxCollapsibleMockComponent {}
|
17
|
-
|
18
|
-
describe('RdxCollapsibleContentDirective', () => {
|
19
|
-
let component: RdxCollapsibleMockComponent;
|
20
|
-
let fixture: ComponentFixture<RdxCollapsibleMockComponent>;
|
21
|
-
|
22
|
-
beforeEach(() => {
|
23
|
-
fixture = TestBed.createComponent(RdxCollapsibleMockComponent);
|
24
|
-
component = fixture.componentInstance;
|
25
|
-
});
|
26
|
-
|
27
|
-
it('should create an instance', () => {
|
28
|
-
expect(component).toBeTruthy();
|
29
|
-
});
|
30
|
-
});
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { Component } from '@angular/core';
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
3
|
-
import { RdxCollapsibleRootDirective } from '../src/collapsible-root.directive';
|
4
|
-
|
5
|
-
@Component({
|
6
|
-
selector: 'rdx-collapsible-mock-trigger',
|
7
|
-
standalone: true,
|
8
|
-
imports: [RdxCollapsibleRootDirective],
|
9
|
-
template: `
|
10
|
-
<div CollapsibleRoot></div>
|
11
|
-
`
|
12
|
-
})
|
13
|
-
class RdxCollapsibleMockComponent {}
|
14
|
-
|
15
|
-
describe('RdxCollapsibleRootDirective', () => {
|
16
|
-
let component: RdxCollapsibleMockComponent;
|
17
|
-
let fixture: ComponentFixture<RdxCollapsibleMockComponent>;
|
18
|
-
|
19
|
-
beforeEach(() => {
|
20
|
-
fixture = TestBed.createComponent(RdxCollapsibleMockComponent);
|
21
|
-
component = fixture.componentInstance;
|
22
|
-
});
|
23
|
-
|
24
|
-
it('should create an instance', () => {
|
25
|
-
expect(component).toBeTruthy();
|
26
|
-
});
|
27
|
-
});
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { Component } from '@angular/core';
|
2
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
3
|
-
import { RdxCollapsibleRootDirective } from '../src/collapsible-root.directive';
|
4
|
-
import { RdxCollapsibleTriggerDirective } from '../src/collapsible-trigger.directive';
|
5
|
-
|
6
|
-
@Component({
|
7
|
-
selector: 'rdx-collapsible-mock-trigger',
|
8
|
-
standalone: true,
|
9
|
-
imports: [RdxCollapsibleRootDirective, RdxCollapsibleTriggerDirective],
|
10
|
-
template: `
|
11
|
-
<div CollapsibleRoot>
|
12
|
-
<button CollapsibleTrigger>Trigger</button>
|
13
|
-
</div>
|
14
|
-
`
|
15
|
-
})
|
16
|
-
class RdxCollapsibleMockComponent {}
|
17
|
-
|
18
|
-
describe('RdxCollapsibleTriggerDirective', () => {
|
19
|
-
let component: RdxCollapsibleMockComponent;
|
20
|
-
let fixture: ComponentFixture<RdxCollapsibleMockComponent>;
|
21
|
-
|
22
|
-
beforeEach(() => {
|
23
|
-
fixture = TestBed.createComponent(RdxCollapsibleMockComponent);
|
24
|
-
component = fixture.componentInstance;
|
25
|
-
});
|
26
|
-
|
27
|
-
it('should create an instance', () => {
|
28
|
-
expect(component).toBeTruthy();
|
29
|
-
});
|
30
|
-
});
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { Directive, ElementRef, inject } from '@angular/core';
|
2
|
-
import { RdxCollapsibleContentToken } from './collapsible-content.token';
|
3
|
-
import { RdxCollapsibleRootDirective } from './collapsible-root.directive';
|
4
|
-
|
5
|
-
@Directive({
|
6
|
-
selector: '[rdxCollapsibleContent]',
|
7
|
-
standalone: true,
|
8
|
-
providers: [
|
9
|
-
{
|
10
|
-
provide: RdxCollapsibleContentToken,
|
11
|
-
useExisting: RdxCollapsibleContentDirective
|
12
|
-
}
|
13
|
-
],
|
14
|
-
host: {
|
15
|
-
'[attr.data-state]': 'collapsible.getState()',
|
16
|
-
'[attr.data-disabled]': 'getDisabled()'
|
17
|
-
}
|
18
|
-
})
|
19
|
-
export class RdxCollapsibleContentDirective {
|
20
|
-
/**
|
21
|
-
* @ignore
|
22
|
-
*/
|
23
|
-
protected readonly collapsible = inject(RdxCollapsibleRootDirective);
|
24
|
-
|
25
|
-
/**
|
26
|
-
* Reference to CollapsibleContent host element
|
27
|
-
* @ignore
|
28
|
-
*/
|
29
|
-
elementRef = inject<ElementRef<HTMLElement>>(ElementRef);
|
30
|
-
|
31
|
-
getDisabled(): string | undefined {
|
32
|
-
return this.collapsible.disabled ? 'disabled' : undefined;
|
33
|
-
}
|
34
|
-
}
|
@@ -1,120 +0,0 @@
|
|
1
|
-
import { contentChild, Directive, EventEmitter, inject, InjectionToken, Input, Output } from '@angular/core';
|
2
|
-
import { asyncScheduler } from 'rxjs';
|
3
|
-
import { RdxCollapsibleContentToken } from './collapsible-content.token';
|
4
|
-
|
5
|
-
const RdxCollapsibleRootToken = new InjectionToken<RdxCollapsibleRootDirective>('RdxCollapsibleRootToken');
|
6
|
-
|
7
|
-
export function injectCollapsible(): RdxCollapsibleRootDirective {
|
8
|
-
return inject(RdxCollapsibleRootDirective);
|
9
|
-
}
|
10
|
-
|
11
|
-
export type RdxCollapsibleState = 'open' | 'closed';
|
12
|
-
|
13
|
-
@Directive({
|
14
|
-
selector: '[rdxCollapsibleRoot]',
|
15
|
-
standalone: true,
|
16
|
-
exportAs: 'collapsibleRoot',
|
17
|
-
providers: [{ provide: RdxCollapsibleRootToken, useExisting: RdxCollapsibleRootDirective }],
|
18
|
-
host: {
|
19
|
-
'[attr.data-state]': 'getState()',
|
20
|
-
'[attr.data-disabled]': 'disabled ? "" : undefined'
|
21
|
-
}
|
22
|
-
})
|
23
|
-
export class RdxCollapsibleRootDirective {
|
24
|
-
/**
|
25
|
-
* Reference to RdxCollapsibleContent directive
|
26
|
-
* @private
|
27
|
-
* @ignore
|
28
|
-
*/
|
29
|
-
private readonly contentDirective = contentChild.required(RdxCollapsibleContentToken);
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Stores collapsible state
|
33
|
-
* @private
|
34
|
-
* @ignore
|
35
|
-
*/
|
36
|
-
private _open = false;
|
37
|
-
|
38
|
-
/**
|
39
|
-
* Determines whether a directive is available for interaction.
|
40
|
-
* When true, prevents the user from interacting with the collapsible.
|
41
|
-
*/
|
42
|
-
@Input() disabled = false;
|
43
|
-
|
44
|
-
/**
|
45
|
-
* The controlled open state of the collapsible.
|
46
|
-
* Sets the state of the directive. `true` - expanded, `false` - collapsed
|
47
|
-
* @param {boolean} value
|
48
|
-
*/
|
49
|
-
@Input() set open(value: boolean) {
|
50
|
-
if (value !== this._open) {
|
51
|
-
this.onOpenChange.emit(value);
|
52
|
-
}
|
53
|
-
|
54
|
-
this._open = value;
|
55
|
-
this.setPresence();
|
56
|
-
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* Emitted with new value when directive state changed.
|
60
|
-
* Event handler called when the open state of the collapsible changes.
|
61
|
-
*/
|
62
|
-
@Output() onOpenChange = new EventEmitter<boolean>();
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Allows to change directive state
|
66
|
-
* @param {boolean | undefined} value
|
67
|
-
*/
|
68
|
-
setOpen(value?: boolean) {
|
69
|
-
if (this.disabled) {
|
70
|
-
return;
|
71
|
-
}
|
72
|
-
|
73
|
-
if (value === undefined) {
|
74
|
-
this.open = !this._open;
|
75
|
-
} else {
|
76
|
-
this.open = value;
|
77
|
-
}
|
78
|
-
|
79
|
-
this.setPresence();
|
80
|
-
}
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Returns directive state (open | closed)
|
84
|
-
*/
|
85
|
-
getState(): RdxCollapsibleState {
|
86
|
-
return this._open ? 'open' : 'closed';
|
87
|
-
}
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Returns current directive state
|
91
|
-
*/
|
92
|
-
isOpen(): boolean {
|
93
|
-
return this._open;
|
94
|
-
}
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Controls visibility of content
|
98
|
-
* @private
|
99
|
-
* @ignore
|
100
|
-
*/
|
101
|
-
private setPresence(): void {
|
102
|
-
if (!this.contentDirective) {
|
103
|
-
return;
|
104
|
-
}
|
105
|
-
|
106
|
-
this.contentDirective().elementRef.nativeElement.setAttribute('data-state', this.getState());
|
107
|
-
|
108
|
-
if (this.isOpen()) {
|
109
|
-
this.contentDirective().elementRef.nativeElement.removeAttribute('hidden');
|
110
|
-
} else {
|
111
|
-
asyncScheduler.schedule(() => {
|
112
|
-
const animations = this.contentDirective().elementRef.nativeElement.getAnimations();
|
113
|
-
|
114
|
-
if (animations === undefined || animations.length === 0) {
|
115
|
-
this.contentDirective().elementRef.nativeElement.setAttribute('hidden', '');
|
116
|
-
}
|
117
|
-
});
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import { Directive } from '@angular/core';
|
2
|
-
import { injectCollapsible, RdxCollapsibleState } from './collapsible-root.directive';
|
3
|
-
|
4
|
-
@Directive({
|
5
|
-
selector: '[rdxCollapsibleTrigger]',
|
6
|
-
standalone: true,
|
7
|
-
host: {
|
8
|
-
'(click)': 'onOpenToggle()',
|
9
|
-
'[attr.data-state]': 'getState()',
|
10
|
-
'[attr.aria-expanded]': 'getState() === "open" ? "true" : "false"',
|
11
|
-
'[disabled]': 'getDisabled()'
|
12
|
-
}
|
13
|
-
})
|
14
|
-
export class RdxCollapsibleTriggerDirective {
|
15
|
-
/**
|
16
|
-
* Reference to CollapsibleRoot
|
17
|
-
* @private
|
18
|
-
* @ignore
|
19
|
-
*/
|
20
|
-
private readonly collapsible = injectCollapsible();
|
21
|
-
|
22
|
-
/**
|
23
|
-
* Called on trigger clicked
|
24
|
-
*/
|
25
|
-
onOpenToggle(): void {
|
26
|
-
this.collapsible.setOpen();
|
27
|
-
}
|
28
|
-
|
29
|
-
/**
|
30
|
-
* Returns current directive state (open | closed)
|
31
|
-
* @ignore
|
32
|
-
*/
|
33
|
-
getState(): RdxCollapsibleState {
|
34
|
-
return this.collapsible.getState();
|
35
|
-
}
|
36
|
-
|
37
|
-
/**
|
38
|
-
* Returns current trigger state
|
39
|
-
* @ignore
|
40
|
-
*/
|
41
|
-
getDisabled(): string | undefined {
|
42
|
-
return this.collapsible.disabled ? 'disabled' : undefined;
|
43
|
-
}
|
44
|
-
}
|