@aquera/nile-elements 0.0.6-1 → 0.0.6-11
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.d.ts +1 -37
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js +1 -120
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/{nile-radio-button/nile-radio-button.css.d.ts → nile-badge/nile-badge.css.d.ts} +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.css.js +63 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.d.ts +45 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.js +80 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/index.js.map +1 -0
- package/{dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts → .rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.d.ts} +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js +52 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.d.ts +39 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js +94 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js +17 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +37 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +76 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js +88 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.d.ts +54 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js +238 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js +0 -162
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.d.ts +5 -21
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +22 -142
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/array.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrayofobject.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrayofobject.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/arrayofobject.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/cases.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/cases.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/cases.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/dowhileloop.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/dowhileloop.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/dowhileloop.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/ifelse.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/ifelse.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/ifelse.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.d.ts +6 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js +6 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/loop.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/loop.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/loop.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/numberinput.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/numberinput.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/numberinput.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/object.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/object.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/object.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/persistentdata.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/persistentdata.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/persistentdata.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringletters.d.ts +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringletters.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/stringletters.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/whileloop.d.ts +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/whileloop.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-icon/icons/svg/whileloop.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-input/nile-input.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-progress-bar/nile-progress-bar.js +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js +3 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js +5 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js +16 -5
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-select/nile-select.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js +3 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +5 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +30 -8
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +128 -34
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js +16 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/demo/filenames.txt +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +515 -475
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.cjs.js.map +1 -1
- package/dist/nile-badge/index.esm.js +1 -55
- package/dist/nile-badge/nile-badge.cjs.js +2 -0
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -0
- package/dist/nile-badge/nile-badge.css.cjs.js +2 -0
- package/dist/nile-badge/nile-badge.css.cjs.js.map +1 -0
- package/dist/nile-badge/nile-badge.css.esm.js +51 -0
- package/dist/nile-badge/nile-badge.esm.js +12 -0
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-button-toggle/index.cjs.js +2 -0
- package/dist/nile-button-toggle/index.esm.js +1 -0
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js +2 -0
- package/dist/nile-button-toggle/nile-button-toggle.cjs.js.map +1 -0
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js +2 -0
- package/dist/nile-button-toggle/nile-button-toggle.css.cjs.js.map +1 -0
- package/dist/nile-button-toggle/nile-button-toggle.css.esm.js +40 -0
- package/dist/nile-button-toggle/nile-button-toggle.esm.js +6 -0
- package/dist/nile-button-toggle-group/index.cjs.js +2 -0
- package/dist/nile-button-toggle-group/index.esm.js +1 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js +2 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.cjs.js.map +1 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.css.cjs.js +2 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.css.cjs.js.map +1 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.css.esm.js +5 -0
- package/dist/nile-button-toggle-group/nile-button-toggle-group.esm.js +3 -0
- package/dist/nile-content-editor/index.cjs.js +2 -0
- package/dist/nile-content-editor/index.cjs.js.map +1 -0
- package/dist/nile-content-editor/index.esm.js +1 -0
- package/dist/nile-content-editor/nile-content-editor.cjs.js +2 -0
- package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -0
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js +2 -0
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -0
- package/dist/nile-content-editor/nile-content-editor.css.esm.js +76 -0
- package/dist/nile-content-editor/nile-content-editor.esm.js +35 -0
- package/dist/nile-date-picker/index.cjs.js +1 -1
- package/dist/nile-date-picker/index.esm.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.css.esm.js +2 -164
- package/dist/nile-date-picker/nile-date-picker.esm.js +4 -5
- package/dist/nile-icon/icons/svg/array.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/array.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/array.esm.js +1 -0
- package/dist/nile-icon/icons/svg/arrayofobject.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/arrayofobject.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/arrayofobject.esm.js +1 -0
- package/dist/nile-icon/icons/svg/cases.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/cases.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/cases.esm.js +1 -1
- package/dist/nile-icon/icons/svg/dowhileloop.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/dowhileloop.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/dowhileloop.esm.js +1 -1
- package/dist/nile-icon/icons/svg/ifelse.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/ifelse.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/ifelse.esm.js +1 -1
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/icons/svg/loop.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/loop.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/loop.esm.js +1 -1
- package/dist/nile-icon/icons/svg/numberinput.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/numberinput.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/numberinput.esm.js +1 -0
- package/dist/nile-icon/icons/svg/object.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/object.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/object.esm.js +1 -0
- package/dist/nile-icon/icons/svg/persistentdata.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/persistentdata.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/persistentdata.esm.js +1 -0
- package/dist/nile-icon/icons/svg/stringletters.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/stringletters.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/stringletters.esm.js +1 -0
- package/dist/nile-icon/icons/svg/whileloop.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/whileloop.cjs.js.map +1 -1
- package/dist/nile-icon/icons/svg/whileloop.esm.js +1 -1
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +1 -1
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +7 -5
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.cjs.js.map +1 -1
- package/dist/nile-progress-bar/nile-progress-bar.esm.js +2 -3
- package/dist/nile-radio-group/nile-radio-group.cjs.js +1 -1
- package/dist/nile-radio-group/nile-radio-group.cjs.js.map +1 -1
- package/dist/nile-radio-group/nile-radio-group.esm.js +9 -7
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.cjs.js +1 -1
- package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.css.esm.js +5 -5
- package/dist/nile-select/nile-select.esm.js +17 -13
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +1 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.esm.js +3 -3
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.css.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.css.esm.js +5 -0
- package/dist/nile-switcher/nile-switcher.esm.js +45 -25
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js +1 -1
- package/dist/nile-textarea/nile-textarea.cjs.js.map +1 -1
- package/dist/nile-textarea/nile-textarea.esm.js +2 -2
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-badge/index.d.ts +1 -37
- package/dist/src/nile-badge/index.js +1 -120
- package/dist/src/nile-badge/index.js.map +1 -1
- package/dist/src/{nile-radio-button/nile-radio-button.css.d.ts → nile-badge/nile-badge.css.d.ts} +1 -1
- package/dist/src/nile-badge/nile-badge.css.js +63 -0
- package/dist/src/nile-badge/nile-badge.css.js.map +1 -0
- package/dist/src/nile-badge/nile-badge.d.ts +45 -0
- package/dist/src/nile-badge/nile-badge.js +80 -0
- package/dist/src/nile-badge/nile-badge.js.map +1 -0
- package/dist/src/nile-button-toggle/index.d.ts +1 -0
- package/dist/src/nile-button-toggle/index.js +2 -0
- package/dist/src/nile-button-toggle/index.js.map +1 -0
- package/{.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.d.ts → dist/src/nile-button-toggle/nile-button-toggle.css.d.ts} +1 -1
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js +52 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.css.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.d.ts +39 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.js +94 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.js.map +1 -0
- package/dist/src/nile-button-toggle-group/index.d.ts +1 -0
- package/dist/src/nile-button-toggle-group/index.js +2 -0
- package/dist/src/nile-button-toggle-group/index.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.d.ts +12 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js +17 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.css.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.d.ts +37 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js +76 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.js.map +1 -0
- package/dist/src/nile-content-editor/index.d.ts +1 -0
- package/dist/src/nile-content-editor/index.js +2 -0
- package/dist/src/nile-content-editor/index.js.map +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.css.d.ts +12 -0
- package/dist/src/nile-content-editor/nile-content-editor.css.js +88 -0
- package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -0
- package/dist/src/nile-content-editor/nile-content-editor.d.ts +54 -0
- package/dist/src/nile-content-editor/nile-content-editor.js +238 -0
- package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.css.js +0 -162
- package/dist/src/nile-date-picker/nile-date-picker.css.js.map +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.d.ts +5 -21
- package/dist/src/nile-date-picker/nile-date-picker.js +22 -142
- package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/array.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/array.js +5 -0
- package/dist/src/nile-icon/icons/svg/array.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/arrayofobject.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/arrayofobject.js +5 -0
- package/dist/src/nile-icon/icons/svg/arrayofobject.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/cases.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/cases.js +1 -1
- package/dist/src/nile-icon/icons/svg/cases.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/dowhileloop.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/dowhileloop.js +1 -1
- package/dist/src/nile-icon/icons/svg/dowhileloop.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/ifelse.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/ifelse.js +1 -1
- package/dist/src/nile-icon/icons/svg/ifelse.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/index.d.ts +6 -0
- package/dist/src/nile-icon/icons/svg/index.js +6 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/loop.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/loop.js +1 -1
- package/dist/src/nile-icon/icons/svg/loop.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/numberinput.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/numberinput.js +5 -0
- package/dist/src/nile-icon/icons/svg/numberinput.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/object.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/object.js +5 -0
- package/dist/src/nile-icon/icons/svg/object.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/persistentdata.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/persistentdata.js +5 -0
- package/dist/src/nile-icon/icons/svg/persistentdata.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/stringletters.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/stringletters.js +5 -0
- package/dist/src/nile-icon/icons/svg/stringletters.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/whileloop.d.ts +1 -1
- package/dist/src/nile-icon/icons/svg/whileloop.js +1 -1
- package/dist/src/nile-icon/icons/svg/whileloop.js.map +1 -1
- package/dist/src/nile-input/nile-input.js +3 -0
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.js +0 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.js +3 -0
- package/dist/src/nile-radio-group/nile-radio-group.js.map +1 -1
- package/dist/src/nile-select/nile-select.css.js +5 -5
- package/dist/src/nile-select/nile-select.css.js.map +1 -1
- package/dist/src/nile-select/nile-select.d.ts +1 -0
- package/dist/src/nile-select/nile-select.js +16 -5
- package/dist/src/nile-select/nile-select.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js +3 -3
- package/dist/src/nile-slide-toggle/nile-slide-toggle.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +5 -0
- package/dist/src/nile-switcher/nile-switcher.css.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.d.ts +30 -8
- package/dist/src/nile-switcher/nile-switcher.js +128 -34
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/src/nile-textarea/nile-textarea.d.ts +1 -0
- package/dist/src/nile-textarea/nile-textarea.js +16 -1
- package/dist/src/nile-textarea/nile-textarea.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -1
- package/src/nile-badge/index.ts +1 -119
- package/src/nile-badge/nile-badge.css.ts +64 -0
- package/src/nile-badge/nile-badge.ts +94 -0
- package/src/nile-button-toggle/index.ts +1 -0
- package/src/nile-button-toggle/nile-button-toggle.css.ts +54 -0
- package/src/nile-button-toggle/nile-button-toggle.ts +99 -0
- package/src/nile-button-toggle-group/index.ts +1 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.css.ts +19 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.ts +90 -0
- package/src/nile-content-editor/index.ts +1 -0
- package/src/nile-content-editor/nile-content-editor.css.ts +90 -0
- package/src/nile-content-editor/nile-content-editor.ts +240 -0
- package/src/nile-date-picker/nile-date-picker.css.ts +0 -162
- package/src/nile-date-picker/nile-date-picker.ts +20 -160
- package/src/nile-icon/icons/svg/array.ts +5 -0
- package/src/nile-icon/icons/svg/arrayofobject.ts +5 -0
- package/src/nile-icon/icons/svg/cases.ts +1 -1
- package/src/nile-icon/icons/svg/dowhileloop.ts +1 -1
- package/src/nile-icon/icons/svg/ifelse.ts +1 -1
- package/src/nile-icon/icons/svg/index.ts +6 -0
- package/src/nile-icon/icons/svg/loop.ts +1 -1
- package/src/nile-icon/icons/svg/numberinput.ts +5 -0
- package/src/nile-icon/icons/svg/object.ts +5 -0
- package/src/nile-icon/icons/svg/persistentdata.ts +5 -0
- package/src/nile-icon/icons/svg/stringletters.ts +5 -0
- package/src/nile-icon/icons/svg/whileloop.ts +1 -1
- package/src/nile-input/nile-input.ts +3 -0
- package/src/nile-progress-bar/nile-progress-bar.ts +0 -1
- package/src/nile-radio-group/nile-radio-group.ts +3 -0
- package/src/nile-select/nile-select.css.ts +5 -5
- package/src/nile-select/nile-select.ts +17 -5
- package/src/nile-slide-toggle/nile-slide-toggle.css.ts +1 -1
- package/src/nile-slide-toggle/nile-slide-toggle.ts +3 -3
- package/src/nile-switcher/nile-switcher.css.ts +5 -0
- package/src/nile-switcher/nile-switcher.ts +181 -36
- package/src/nile-textarea/nile-textarea.ts +17 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.d.ts +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js +0 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/index.js.map +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js +0 -173
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.css.js.map +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.d.ts +0 -57
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js +0 -145
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button/nile-radio-button.js.map +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.d.ts +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js +0 -2
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/index.js.map +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +0 -70
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +0 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +0 -66
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js +0 -308
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +0 -1
- package/dist/nile-radio-button/index.cjs.js +0 -2
- package/dist/nile-radio-button/index.esm.js +0 -1
- package/dist/nile-radio-button/nile-radio-button.cjs.js +0 -2
- package/dist/nile-radio-button/nile-radio-button.cjs.js.map +0 -1
- package/dist/nile-radio-button/nile-radio-button.css.cjs.js +0 -2
- package/dist/nile-radio-button/nile-radio-button.css.cjs.js.map +0 -1
- package/dist/nile-radio-button/nile-radio-button.css.esm.js +0 -161
- package/dist/nile-radio-button/nile-radio-button.esm.js +0 -21
- package/dist/nile-radio-button-group/index.cjs.js +0 -2
- package/dist/nile-radio-button-group/index.esm.js +0 -1
- package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js +0 -2
- package/dist/nile-radio-button-group/nile-radio-button-group.cjs.js.map +0 -1
- package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js +0 -2
- package/dist/nile-radio-button-group/nile-radio-button-group.css.cjs.js.map +0 -1
- package/dist/nile-radio-button-group/nile-radio-button-group.css.esm.js +0 -58
- package/dist/nile-radio-button-group/nile-radio-button-group.esm.js +0 -56
- package/dist/src/nile-radio-button/index.d.ts +0 -1
- package/dist/src/nile-radio-button/index.js +0 -2
- package/dist/src/nile-radio-button/index.js.map +0 -1
- package/dist/src/nile-radio-button/nile-radio-button.css.js +0 -173
- package/dist/src/nile-radio-button/nile-radio-button.css.js.map +0 -1
- package/dist/src/nile-radio-button/nile-radio-button.d.ts +0 -57
- package/dist/src/nile-radio-button/nile-radio-button.js +0 -145
- package/dist/src/nile-radio-button/nile-radio-button.js.map +0 -1
- package/dist/src/nile-radio-button-group/index.d.ts +0 -1
- package/dist/src/nile-radio-button-group/index.js +0 -2
- package/dist/src/nile-radio-button-group/index.js.map +0 -1
- package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js +0 -70
- package/dist/src/nile-radio-button-group/nile-radio-button-group.css.js.map +0 -1
- package/dist/src/nile-radio-button-group/nile-radio-button-group.d.ts +0 -66
- package/dist/src/nile-radio-button-group/nile-radio-button-group.js +0 -308
- package/dist/src/nile-radio-button-group/nile-radio-button-group.js.map +0 -1
- package/src/nile-radio-button/index.ts +0 -1
- package/src/nile-radio-button/nile-radio-button.css.ts +0 -175
- package/src/nile-radio-button/nile-radio-button.ts +0 -151
- package/src/nile-radio-button-group/index.ts +0 -1
- package/src/nile-radio-button-group/nile-radio-button-group.css.ts +0 -72
- package/src/nile-radio-button-group/nile-radio-button-group.ts +0 -337
- /package/dist/{nile-radio-button → nile-button-toggle}/index.cjs.js.map +0 -0
- /package/dist/{nile-radio-button-group → nile-button-toggle-group}/index.cjs.js.map +0 -0
@@ -1,308 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { classMap } from 'lit/directives/class-map.js';
|
3
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
4
|
-
import { HasSlotController } from '../internal/slot';
|
5
|
-
import { html } from 'lit';
|
6
|
-
import { watch } from '../internal/watch';
|
7
|
-
import NileElement from '../internal/nile-element';
|
8
|
-
import styles from './nile-radio-button-group.css';
|
9
|
-
/**
|
10
|
-
* @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.
|
11
|
-
*
|
12
|
-
* @dependency nile-button-group
|
13
|
-
*
|
14
|
-
* @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.
|
15
|
-
* @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`
|
16
|
-
* attribute.
|
17
|
-
*
|
18
|
-
* @event change - Emitted when the radio group's selected value changes.
|
19
|
-
* @event input - Emitted when the radio group receives user input.
|
20
|
-
* @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.
|
21
|
-
* @csspart button-group - The button group that wraps radio buttons.
|
22
|
-
* @csspart button-group__base - The button group's `base` part.
|
23
|
-
*/
|
24
|
-
let NileRadioButtonGroup = class NileRadioButtonGroup extends NileElement {
|
25
|
-
constructor() {
|
26
|
-
super(...arguments);
|
27
|
-
this.hasSlotController = new HasSlotController(this, 'help-text', 'label');
|
28
|
-
this.customValidityMessage = '';
|
29
|
-
this.hasButtonGroup = false;
|
30
|
-
this.defaultValue = '';
|
31
|
-
/**
|
32
|
-
* The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot
|
33
|
-
* instead.
|
34
|
-
*/
|
35
|
-
this.label = '';
|
36
|
-
/** The name of the radio group, submitted as a name/value pair with form data. */
|
37
|
-
this.name = 'option';
|
38
|
-
/** The current value of the radio group, submitted as a name/value pair with form data. */
|
39
|
-
this.value = '';
|
40
|
-
/**
|
41
|
-
* By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you
|
42
|
-
* to place the form control outside of a form and associate it with the form that has this `id`. The form must be in
|
43
|
-
* the same document or shadow root for this to work.
|
44
|
-
*/
|
45
|
-
this.form = '';
|
46
|
-
/** Ensures a child radio is checked before allowing the containing form to submit. */
|
47
|
-
this.required = false;
|
48
|
-
/** Used to show radio in inline or not */
|
49
|
-
this.labelInline = false;
|
50
|
-
/** Used to disabled or not */
|
51
|
-
this.disabled = false;
|
52
|
-
this.helpText = '';
|
53
|
-
this.errorMessage = '';
|
54
|
-
}
|
55
|
-
connectedCallback() {
|
56
|
-
super.connectedCallback();
|
57
|
-
this.defaultValue = this.value;
|
58
|
-
this.handleInitialDisabledState();
|
59
|
-
}
|
60
|
-
getAllRadios() {
|
61
|
-
return [...this.querySelectorAll('nile-radio-button')];
|
62
|
-
}
|
63
|
-
handleRadioClick(event) {
|
64
|
-
const target = event.target.closest('nile-radio-button');
|
65
|
-
const radios = this.getAllRadios();
|
66
|
-
const oldValue = this.value;
|
67
|
-
if (target.disabled) {
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
this.value = target.value;
|
71
|
-
radios.forEach(radio => (radio.checked = radio === target));
|
72
|
-
if (this.value !== oldValue) {
|
73
|
-
this.emit('nile-change', { value: this.value });
|
74
|
-
this.emit('input');
|
75
|
-
}
|
76
|
-
}
|
77
|
-
handleDisabledChange() {
|
78
|
-
this.getAllRadios().forEach(radio => {
|
79
|
-
radio.disabled = this.disabled;
|
80
|
-
});
|
81
|
-
}
|
82
|
-
handleInitialDisabledState() {
|
83
|
-
this.getAllRadios().forEach(radio => {
|
84
|
-
radio.disabled = radio.hasAttribute('disabled')
|
85
|
-
? radio.disabled
|
86
|
-
: this.disabled;
|
87
|
-
});
|
88
|
-
}
|
89
|
-
handleKeyDown(event) {
|
90
|
-
if (!['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(event.key)) {
|
91
|
-
return;
|
92
|
-
}
|
93
|
-
const radios = this.getAllRadios().filter(radio => !radio.disabled);
|
94
|
-
const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];
|
95
|
-
const incr = event.key === ' '
|
96
|
-
? 0
|
97
|
-
: ['ArrowUp', 'ArrowLeft'].includes(event.key)
|
98
|
-
? -1
|
99
|
-
: 1;
|
100
|
-
const oldValue = this.value;
|
101
|
-
let index = radios.indexOf(checkedRadio) + incr;
|
102
|
-
if (index < 0) {
|
103
|
-
index = radios.length - 1;
|
104
|
-
}
|
105
|
-
if (index > radios.length - 1) {
|
106
|
-
index = 0;
|
107
|
-
}
|
108
|
-
this.getAllRadios().forEach(radio => {
|
109
|
-
radio.checked = false;
|
110
|
-
if (!this.hasButtonGroup) {
|
111
|
-
radio.tabIndex = -1;
|
112
|
-
}
|
113
|
-
});
|
114
|
-
this.value = radios[index].value;
|
115
|
-
radios[index].checked = true;
|
116
|
-
if (!this.hasButtonGroup) {
|
117
|
-
radios[index].tabIndex = 0;
|
118
|
-
radios[index].focus();
|
119
|
-
}
|
120
|
-
else {
|
121
|
-
radios[index].shadowRoot.querySelector('button').focus();
|
122
|
-
}
|
123
|
-
if (this.value !== oldValue) {
|
124
|
-
this.emit('change');
|
125
|
-
this.emit('input');
|
126
|
-
}
|
127
|
-
event.preventDefault();
|
128
|
-
}
|
129
|
-
handleLabelClick() {
|
130
|
-
const radios = this.getAllRadios();
|
131
|
-
const checked = radios.find(radio => radio.checked);
|
132
|
-
const radioToFocus = checked || radios[0];
|
133
|
-
// Move focus to the checked radio (or the first one if none are checked) when clicking the label
|
134
|
-
if (radioToFocus) {
|
135
|
-
radioToFocus.focus();
|
136
|
-
}
|
137
|
-
}
|
138
|
-
handleSlotChange() {
|
139
|
-
const radios = this.getAllRadios();
|
140
|
-
radios.forEach(radio => (radio.checked = radio.value === this.value));
|
141
|
-
this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === 'nile-radio-button');
|
142
|
-
if (!radios.some(radio => radio.checked)) {
|
143
|
-
if (this.hasButtonGroup) {
|
144
|
-
const buttonRadio = radios[0].shadowRoot.querySelector('button');
|
145
|
-
buttonRadio.tabIndex = 0;
|
146
|
-
}
|
147
|
-
else {
|
148
|
-
radios[0].tabIndex = 0;
|
149
|
-
}
|
150
|
-
}
|
151
|
-
if (this.hasButtonGroup) {
|
152
|
-
const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');
|
153
|
-
}
|
154
|
-
const slottedElements = [
|
155
|
-
...this.defaultSlot.assignedElements({ flatten: true }),
|
156
|
-
];
|
157
|
-
// console.log(slottedElements);
|
158
|
-
slottedElements.forEach(el => {
|
159
|
-
const index = slottedElements.indexOf(el);
|
160
|
-
const button = this.findButton(el);
|
161
|
-
if (button !== null) {
|
162
|
-
button.classList.toggle('nile-radio-button--first', index === 0);
|
163
|
-
button.classList.toggle('nile-radio-button--inner', index > 0 && index < slottedElements.length - 1);
|
164
|
-
button.classList.toggle('nile-radio-button--last', index === slottedElements.length - 1);
|
165
|
-
}
|
166
|
-
});
|
167
|
-
}
|
168
|
-
findButton(el) {
|
169
|
-
const selector = 'nile-radio-button';
|
170
|
-
return el.closest(selector) ?? el.querySelector(selector);
|
171
|
-
}
|
172
|
-
updateCheckedRadio() {
|
173
|
-
const radios = this.getAllRadios();
|
174
|
-
radios.forEach(radio => (radio.checked = radio.value === this.value));
|
175
|
-
}
|
176
|
-
handleValueChange() {
|
177
|
-
if (this.hasUpdated) {
|
178
|
-
this.updateCheckedRadio();
|
179
|
-
}
|
180
|
-
}
|
181
|
-
render() {
|
182
|
-
const hasLabelSlot = this.hasSlotController.test('label');
|
183
|
-
const hasHelpTextSlot = this.hasSlotController.test('help-text');
|
184
|
-
const hasLabel = this.label ? true : !!hasLabelSlot;
|
185
|
-
const hasHelpText = this.helpText ? true : false;
|
186
|
-
const hasErrorMessage = this.errorMessage ? true : false;
|
187
|
-
const defaultSlot = html `
|
188
|
-
<slot
|
189
|
-
@click=${this.handleRadioClick}
|
190
|
-
@keydown=${this.handleKeyDown}
|
191
|
-
@slotchange=${this.handleSlotChange}
|
192
|
-
role="presentation"
|
193
|
-
></slot>
|
194
|
-
`;
|
195
|
-
return html `
|
196
|
-
<fieldset
|
197
|
-
part="form-control"
|
198
|
-
class=${classMap({
|
199
|
-
'form-control': true,
|
200
|
-
'form-control--medium': true,
|
201
|
-
'form-control--radio-group': true,
|
202
|
-
'form-control--has-label': hasLabel,
|
203
|
-
'form-control--has-help-text': hasHelpText,
|
204
|
-
})}
|
205
|
-
role="radiogroup"
|
206
|
-
aria-labelledby="label"
|
207
|
-
aria-describedby="help-text"
|
208
|
-
aria-errormessage="error-message"
|
209
|
-
>
|
210
|
-
<label
|
211
|
-
part="form-control-label"
|
212
|
-
id="label"
|
213
|
-
class="form-control__label"
|
214
|
-
aria-hidden=${hasLabel ? 'false' : 'true'}
|
215
|
-
@click=${this.handleLabelClick}
|
216
|
-
>
|
217
|
-
<slot name="label">${this.label}</slot>
|
218
|
-
</label>
|
219
|
-
|
220
|
-
<div part="form-control-input" class="form-control-input">
|
221
|
-
<div class="visually-hidden">
|
222
|
-
<label class="radio-group__validation">
|
223
|
-
<input
|
224
|
-
type="text"
|
225
|
-
class="radio-group__validation-input"
|
226
|
-
?required=${this.required}
|
227
|
-
tabindex="-1"
|
228
|
-
hidden
|
229
|
-
/>
|
230
|
-
</label>
|
231
|
-
</div>
|
232
|
-
|
233
|
-
${this.hasButtonGroup
|
234
|
-
? html ` ${defaultSlot} `
|
235
|
-
: html `
|
236
|
-
<div
|
237
|
-
class="${this.labelInline
|
238
|
-
? `form-control--inline-radio`
|
239
|
-
: ``}"
|
240
|
-
>
|
241
|
-
${defaultSlot}
|
242
|
-
</div>
|
243
|
-
`}
|
244
|
-
</div>
|
245
|
-
|
246
|
-
${hasHelpText
|
247
|
-
? html ` <nile-form-help-text>${this.helpText}</nile-form-help-text> `
|
248
|
-
: ``}
|
249
|
-
${hasErrorMessage
|
250
|
-
? html `
|
251
|
-
<nile-form-error-message
|
252
|
-
>${this.errorMessage}</nile-form-error-message
|
253
|
-
>
|
254
|
-
`
|
255
|
-
: ``}
|
256
|
-
</fieldset>
|
257
|
-
`;
|
258
|
-
}
|
259
|
-
};
|
260
|
-
NileRadioButtonGroup.styles = styles;
|
261
|
-
__decorate([
|
262
|
-
query('slot:not([name])')
|
263
|
-
], NileRadioButtonGroup.prototype, "defaultSlot", void 0);
|
264
|
-
__decorate([
|
265
|
-
state()
|
266
|
-
], NileRadioButtonGroup.prototype, "hasButtonGroup", void 0);
|
267
|
-
__decorate([
|
268
|
-
state()
|
269
|
-
], NileRadioButtonGroup.prototype, "defaultValue", void 0);
|
270
|
-
__decorate([
|
271
|
-
property()
|
272
|
-
], NileRadioButtonGroup.prototype, "label", void 0);
|
273
|
-
__decorate([
|
274
|
-
property()
|
275
|
-
], NileRadioButtonGroup.prototype, "name", void 0);
|
276
|
-
__decorate([
|
277
|
-
property({ reflect: true })
|
278
|
-
], NileRadioButtonGroup.prototype, "value", void 0);
|
279
|
-
__decorate([
|
280
|
-
property({ reflect: true })
|
281
|
-
], NileRadioButtonGroup.prototype, "form", void 0);
|
282
|
-
__decorate([
|
283
|
-
property({ type: Boolean, reflect: true })
|
284
|
-
], NileRadioButtonGroup.prototype, "required", void 0);
|
285
|
-
__decorate([
|
286
|
-
property({ type: Boolean, reflect: true })
|
287
|
-
], NileRadioButtonGroup.prototype, "labelInline", void 0);
|
288
|
-
__decorate([
|
289
|
-
property({ type: Boolean, reflect: true })
|
290
|
-
], NileRadioButtonGroup.prototype, "disabled", void 0);
|
291
|
-
__decorate([
|
292
|
-
property({ attribute: 'help-text' })
|
293
|
-
], NileRadioButtonGroup.prototype, "helpText", void 0);
|
294
|
-
__decorate([
|
295
|
-
property({ attribute: 'error-message' })
|
296
|
-
], NileRadioButtonGroup.prototype, "errorMessage", void 0);
|
297
|
-
__decorate([
|
298
|
-
watch('disabled', { waitUntilFirstUpdate: true })
|
299
|
-
], NileRadioButtonGroup.prototype, "handleDisabledChange", null);
|
300
|
-
__decorate([
|
301
|
-
watch('value')
|
302
|
-
], NileRadioButtonGroup.prototype, "handleValueChange", null);
|
303
|
-
NileRadioButtonGroup = __decorate([
|
304
|
-
customElement('nile-radio-button-group')
|
305
|
-
], NileRadioButtonGroup);
|
306
|
-
export { NileRadioButtonGroup };
|
307
|
-
export default NileRadioButtonGroup;
|
308
|
-
//# sourceMappingURL=nile-radio-button-group.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-radio-button-group.js","sourceRoot":"","sources":["../../../src/nile-radio-button-group/nile-radio-button-group.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAInD;;;;;;;;;;;;;;GAcG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,WAAW;IAA9C;;QAGY,sBAAiB,GAAG,IAAI,iBAAiB,CACxD,IAAI,EACJ,WAAW,EACX,OAAO,CACR,CAAC;QACM,0BAAqB,GAAG,EAAE,CAAC;QAIlB,mBAAc,GAAG,KAAK,CAAC;QAE/B,iBAAY,GAAG,EAAE,CAAC;QAE3B;;;WAGG;QACS,UAAK,GAAG,EAAE,CAAC;QAEvB,kFAAkF;QACtE,SAAI,GAAG,QAAQ,CAAC;QAE5B,2FAA2F;QAC9D,UAAK,GAAG,EAAE,CAAC;QAExC;;;;WAIG;QAC0B,SAAI,GAAG,EAAE,CAAC;QAEvC,sFAAsF;QAC1C,aAAQ,GAAG,KA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AA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAY;AAOX;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAW;AAGK;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAAkB;AAGjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDAAqB;AAGpB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sDAAkB;AAEvB;IAArC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sDAAe;AAEV;IAAzC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;0DAAmB;AAiC5D;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;gEAKjD;AAqID;IADC,KAAK,CAAC,OAAO,CAAC;6DAKd;AA5NU,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CA8ShC;SA9SY,oBAAoB;AAgTjC,eAAe,oBAAoB,CAAC","sourcesContent":["import { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { HasSlotController } from '../internal/slot';\nimport { html } from 'lit';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport styles from './nile-radio-button-group.css';\nimport type { CSSResultGroup } from 'lit';\nimport type NileRadioButton from '../nile-radio-button/nile-radio-button';\n\n/**\n * @summary Radio groups are used to group multiple [radios](/components/radio) or [radio buttons](/components/radio-button) so they function as a single form control.\n *\n * @dependency nile-button-group\n *\n * @slot - The default slot where `<nile-radio>` or `<nile-radio-button>` elements are placed.\n * @slot label - The radio group's label. Required for proper accessibility. Alternatively, you can use the `label`\n * attribute.\n *\n * @event change - Emitted when the radio group's selected value changes.\n * @event input - Emitted when the radio group receives user input.\n * @event invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied.\n * @csspart button-group - The button group that wraps radio buttons.\n * @csspart button-group__base - The button group's `base` part.\n */\n@customElement('nile-radio-button-group')\nexport class NileRadioButtonGroup extends NileElement {\n static styles: CSSResultGroup = styles;\n\n private readonly hasSlotController = new HasSlotController(\n this,\n 'help-text',\n 'label'\n );\n private customValidityMessage = '';\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n\n @state() private hasButtonGroup = false;\n\n @state() defaultValue = '';\n\n /**\n * The radio group's label. Required for proper accessibility. If you need to display HTML, use the `label` slot\n * instead.\n */\n @property() label = '';\n\n /** The name of the radio group, submitted as a name/value pair with form data. */\n @property() name = 'option';\n\n /** The current value of the radio group, submitted as a name/value pair with form data. */\n @property({ reflect: true }) value = '';\n\n /**\n * By default, form controls are associated with the nearest containing `<form>` element. This attribute allows you\n * to place the form control outside of a form and associate it with the form that has this `id`. The form must be in\n * the same document or shadow root for this to work.\n */\n @property({ reflect: true }) form = '';\n\n /** Ensures a child radio is checked before allowing the containing form to submit. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n /** Used to show radio in inline or not */\n @property({ type: Boolean, reflect: true }) labelInline = false;\n\n /** Used to disabled or not */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @property({ attribute: 'help-text' }) helpText = '';\n\n @property({ attribute: 'error-message' }) errorMessage = '';\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.handleInitialDisabledState();\n }\n\n private getAllRadios() {\n return [...this.querySelectorAll<NileRadioButton>('nile-radio-button')];\n }\n\n private handleRadioClick(event: MouseEvent) {\n const target = (event.target as HTMLElement).closest<NileRadioButton>(\n 'nile-radio-button'\n )!;\n const radios = this.getAllRadios();\n const oldValue = this.value;\n\n if (target.disabled) {\n return;\n }\n\n this.value = target.value;\n radios.forEach(radio => (radio.checked = radio === target));\n\n if (this.value !== oldValue) {\n this.emit('nile-change', { value: this.value });\n this.emit('input');\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = this.disabled;\n });\n }\n\n private handleInitialDisabledState() {\n this.getAllRadios().forEach(radio => {\n radio.disabled = radio.hasAttribute('disabled')\n ? radio.disabled\n : this.disabled;\n });\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (\n !['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(\n event.key\n )\n ) {\n return;\n }\n\n const radios = this.getAllRadios().filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n const incr =\n event.key === ' '\n ? 0\n : ['ArrowUp', 'ArrowLeft'].includes(event.key)\n ? -1\n : 1;\n const oldValue = this.value;\n let index = radios.indexOf(checkedRadio) + incr;\n\n if (index < 0) {\n index = radios.length - 1;\n }\n\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this.getAllRadios().forEach(radio => {\n radio.checked = false;\n\n if (!this.hasButtonGroup) {\n radio.tabIndex = -1;\n }\n });\n\n this.value = radios[index].value;\n radios[index].checked = true;\n\n if (!this.hasButtonGroup) {\n radios[index].tabIndex = 0;\n radios[index].focus();\n } else {\n radios[index].shadowRoot!.querySelector('button')!.focus();\n }\n\n if (this.value !== oldValue) {\n this.emit('change');\n this.emit('input');\n }\n\n event.preventDefault();\n }\n\n private handleLabelClick() {\n const radios = this.getAllRadios();\n const checked = radios.find(radio => radio.checked);\n const radioToFocus = checked || radios[0];\n\n // Move focus to the checked radio (or the first one if none are checked) when clicking the label\n if (radioToFocus) {\n radioToFocus.focus();\n }\n }\n\n private handleSlotChange() {\n const radios = this.getAllRadios();\n\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n\n this.hasButtonGroup = radios.some(\n radio => radio.tagName.toLowerCase() === 'nile-radio-button'\n );\n\n if (!radios.some(radio => radio.checked)) {\n if (this.hasButtonGroup) {\n const buttonRadio = radios[0].shadowRoot!.querySelector('button')!;\n buttonRadio.tabIndex = 0;\n } else {\n radios[0].tabIndex = 0;\n }\n }\n\n if (this.hasButtonGroup) {\n const buttonGroup = this.shadowRoot?.querySelector('nile-button-group');\n }\n\n const slottedElements = [\n ...this.defaultSlot.assignedElements({ flatten: true }),\n ] as HTMLElement[];\n\n // console.log(slottedElements);\n\n slottedElements.forEach(el => {\n const index = slottedElements.indexOf(el);\n const button = this.findButton(el);\n\n if (button !== null) {\n button.classList.toggle('nile-radio-button--first', index === 0);\n button.classList.toggle(\n 'nile-radio-button--inner',\n index > 0 && index < slottedElements.length - 1\n );\n button.classList.toggle(\n 'nile-radio-button--last',\n index === slottedElements.length - 1\n );\n }\n });\n }\n\n private findButton(el: HTMLElement) {\n const selector = 'nile-radio-button';\n\n return el.closest(selector) ?? el.querySelector(selector);\n }\n\n private updateCheckedRadio() {\n const radios = this.getAllRadios();\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n @watch('value')\n handleValueChange() {\n if (this.hasUpdated) {\n this.updateCheckedRadio();\n }\n }\n\n render() {\n const hasLabelSlot = this.hasSlotController.test('label');\n const hasHelpTextSlot = this.hasSlotController.test('help-text');\n const hasLabel = this.label ? true : !!hasLabelSlot;\n const hasHelpText = this.helpText ? true : false;\n const hasErrorMessage = this.errorMessage ? true : false;\n\n const defaultSlot = html`\n <slot\n @click=${this.handleRadioClick}\n @keydown=${this.handleKeyDown}\n @slotchange=${this.handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n\n return html`\n <fieldset\n part=\"form-control\"\n class=${classMap({\n 'form-control': true,\n 'form-control--medium': true,\n 'form-control--radio-group': true,\n 'form-control--has-label': hasLabel,\n 'form-control--has-help-text': hasHelpText,\n })}\n role=\"radiogroup\"\n aria-labelledby=\"label\"\n aria-describedby=\"help-text\"\n aria-errormessage=\"error-message\"\n >\n <label\n part=\"form-control-label\"\n id=\"label\"\n class=\"form-control__label\"\n aria-hidden=${hasLabel ? 'false' : 'true'}\n @click=${this.handleLabelClick}\n >\n <slot name=\"label\">${this.label}</slot>\n </label>\n\n <div part=\"form-control-input\" class=\"form-control-input\">\n <div class=\"visually-hidden\">\n <label class=\"radio-group__validation\">\n <input\n type=\"text\"\n class=\"radio-group__validation-input\"\n ?required=${this.required}\n tabindex=\"-1\"\n hidden\n />\n </label>\n </div>\n\n ${this.hasButtonGroup\n ? html` ${defaultSlot} `\n : html`\n <div\n class=\"${this.labelInline\n ? `form-control--inline-radio`\n : ``}\"\n >\n ${defaultSlot}\n </div>\n `}\n </div>\n\n ${hasHelpText\n ? html` <nile-form-help-text>${this.helpText}</nile-form-help-text> `\n : ``}\n ${hasErrorMessage\n ? html`\n <nile-form-error-message\n >${this.errorMessage}</nile-form-error-message\n >\n `\n : ``}\n </fieldset>\n `;\n }\n}\n\nexport default NileRadioButtonGroup;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-button-group': NileRadioButtonGroup;\n }\n}\n"]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register(["./nile-radio-button.cjs.js","tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-radio-button.css.cjs.js","../internal/nile-element.cjs.js","lit","../slot.cjs.js","lit/directives/class-map.js","lit/directives/if-defined.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileRadioButtonCjsJs){_export("NileRadioButton",_nileRadioButtonCjsJs.N);},function(_tslib){},function(_index001CjsJs){},function(_litDecoratorsJs){},function(_nileRadioButtonCssCjsJs){},function(_internalNileElementCjsJs){},function(_lit){},function(_slotCjsJs){},function(_litDirectivesClassMapJs){},function(_litDirectivesIfDefinedJs){},function(_internalWatchCjsJs){},function(_property002CjsJs){}],execute:function(){}};});
|
2
|
-
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
export{N as NileRadioButton}from"./nile-radio-button.esm.js";import"tslib";import"../index-cd2f9c12.esm.js";import"lit/decorators.js";import"./nile-radio-button.css.esm.js";import"../internal/nile-element.esm.js";import"lit";import"../slot.esm.js";import"lit/directives/class-map.js";import"lit/directives/if-defined.js";import"../internal/watch.esm.js";import"../property-09139d3c.esm.js";
|
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register(["tslib","../index-cd83c5c8.cjs.js","lit/decorators.js","./nile-radio-button.css.cjs.js","../internal/nile-element.cjs.js","../slot.cjs.js","lit/directives/class-map.js","lit/directives/if-defined.js","../internal/watch.cjs.js","../property-0f6a51ec.cjs.js","lit"],function(_export,_context){"use strict";var t,i,s,e,o,l,r,a,n,d,u,h,_templateObject,c;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return typeof key==="symbol"?key:String(key);}function _toPrimitive(input,hint){if(typeof input!=="object"||input===null)return input;var prim=input[Symbol.toPrimitive];if(prim!==undefined){var res=prim.call(input,hint||"default");if(typeof res!=="object")return res;throw new TypeError("@@toPrimitive must return a primitive value.");}return(hint==="string"?String:Number)(input);}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get.bind();}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(typeof call==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_index001CjsJs){i=_index001CjsJs.x;},function(_litDecoratorsJs){s=_litDecoratorsJs.query;e=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_nileRadioButtonCssCjsJs){l=_nileRadioButtonCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_slotCjsJs){a=_slotCjsJs.H;},function(_litDirectivesClassMapJs){n=_litDirectivesClassMapJs.classMap;},function(_litDirectivesIfDefinedJs){d=_litDirectivesIfDefinedJs.ifDefined;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_property002CjsJs){h=_property002CjsJs.n;},function(_lit){}],execute:function(){_export("N",c=/*#__PURE__*/function(_r){_inherits(c,_r);var _super=_createSuper(c);function c(){var _this;_classCallCheck(this,c);_this=_super.apply(this,arguments),_this.hasSlotController=new a(_assertThisInitialized(_this),"[default]","prefix","suffix"),_this.hasFocus=!1,_this.checked=!1,_this.disabled=!1,_this.size="medium",_this.pill=!1;return _this;}_createClass(c,[{key:"connectedCallback",value:function connectedCallback(){_get(_getPrototypeOf(c.prototype),"connectedCallback",this).call(this),this.setAttribute("role","presentation");}},{key:"handleBlur",value:function handleBlur(){this.hasFocus=!1,this.emit("nile-blur");}},{key:"handleClick",value:function handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0;}},{key:"handleFocus",value:function handleFocus(){this.hasFocus=!0,this.emit("nile-focus");}},{key:"handleDisabledChange",value:function handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false");}},{key:"focus",value:function focus(t){this.input.focus(t);}},{key:"blur",value:function blur(){this.input.blur();}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div part=\"base\" role=\"presentation\">\n <button\n part=\"","\"\n role=\"radio\"\n aria-checked=\"","\"\n class=","\n aria-disabled=","\n type=\"button\"\n value=","\n tabindex=\"","\"\n @blur=","\n @focus=","\n @click=","\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n </button>\n </div>\n "])),"button"+(this.checked?" button--checked":""),this.checked,n({button:!0,"button--default":!0,"button--checked":this.checked,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")}),this.disabled,d(this.value),this.checked?"0":"-1",this.handleBlur,this.handleFocus,this.handleClick);}}],[{key:"styles",get:function get(){return[l];}}]);return c;}(r));t([s(".button")],c.prototype,"input",void 0),t([s(".hidden-input")],c.prototype,"hiddenInput",void 0),t([e()],c.prototype,"hasFocus",void 0),t([h({type:Boolean,reflect:!0})],c.prototype,"checked",void 0),t([h()],c.prototype,"value",void 0),t([h({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),t([h({reflect:!0})],c.prototype,"size",void 0),t([h({type:Boolean,reflect:!0})],c.prototype,"pill",void 0),t([u("disabled",{waitUntilFirstUpdate:!0})],c.prototype,"handleDisabledChange",null),_export("N",c=t([o("nile-radio-button")],c));}};});
|
2
|
-
//# sourceMappingURL=nile-radio-button.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-radio-button.cjs.js","sources":["../../../src/nile-radio-button/nile-radio-button.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n LitElement,\n html,\n property,\n CSSResultArray,\n TemplateResult,\n} from 'lit-element';\nimport { customElement, query, state } from 'lit/decorators.js';\nimport { styles } from './nile-radio-button.css';\nimport NileElement from '../internal/nile-element';\nimport { HasSlotController } from '../slot';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { watch } from '../internal/watch';\n\n/**\n * Nile icon component.\n *\n * @tag nile-radio-button\n *\n */\n@customElement('nile-radio-button')\nexport class NileRadioButton extends NileElement {\n /**\n * The styles for RadioButton\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n private readonly hasSlotController = new HasSlotController(\n this,\n '[default]',\n 'prefix',\n 'suffix'\n );\n\n @query('.button') input: HTMLInputElement;\n @query('.hidden-input') hiddenInput: HTMLInputElement;\n\n @state() protected hasFocus = false;\n\n /**\n * @internal The radio button's checked state. This is exposed as an \"internal\" attribute so we can reflect it, making\n * it easier to style in button groups.\n */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** The radio's value. When selected, the radio group will receive this value. */\n @property() value: string;\n\n /** Disables the radio button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so\n * this attribute can typically be omitted.\n */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Draws a pill-style radio button with rounded edges. */\n @property({ type: Boolean, reflect: true }) pill = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'presentation');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('nile-blur');\n }\n\n private handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n this.checked = true;\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('nile-focus');\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n /** Sets focus on the radio button. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the radio button. */\n blur() {\n this.input.blur();\n }\n\n render() {\n return html`\n <div part=\"base\" role=\"presentation\">\n <button\n part=\"${`button${this.checked ? ' button--checked' : ''}`}\"\n role=\"radio\"\n aria-checked=\"${this.checked}\"\n class=${classMap({\n button: true,\n 'button--default': true,\n 'button--checked': this.checked,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix'),\n })}\n aria-disabled=${this.disabled}\n type=\"button\"\n value=${ifDefined(this.value)}\n tabindex=\"${this.checked ? '0' : '-1'}\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n </button>\n </div>\n `;\n }\n}\n\nexport default NileRadioButton;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-radio-button': NileRadioButton;\n }\n}\n"],"names":["NileRadioButton","c","constructor","this","hasSlotController","HasSlotController","hasFocus","checked","disabled","size","pill","_this","_createClass","key","value","connectedCallback","super","setAttribute","handleBlur","emit","handleClick","e","preventDefault","stopPropagation","handleFocus","handleDisabledChange","focus","options","input","blur","render","html","_templateObject","_taggedTemplateLiteral","classMap","button","test","ifDefined","__decorate","get","styles","NileElement","query","prototype","state","property","type","Boolean","reflect","watch","waitUntilFirstUpdate","customElement"],"mappings":"4tJA6BaA,CAAAA,uBAAAA,EAAAA,EAAAA,SAAAA,CAAAA,CAAAA,CAAAA,EAAAA,MAAAA,MAAAA,CAAAA,YAAAA,CAAAA,CAAAA,EAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCAQYC,EAAAA,KAAAA,CAAAC,iBAAoB,CAAA,GAAIC,CAAAA,CACvCF,CAAAA,sBAAAA,CAAAA,KAAAA,EACA,WACA,CAAA,QAAA,CACA,QAMiBA,CAAAA,CAAAA,KAAAA,CAAQG,QAAG,CAAA,CAAA,CAAA,CAMcH,KAAAA,CAAOI,OAAAA,CAAAA,CAAG,CAMVJ,CAAAA,KAAAA,CAAQK,QAAG,CAAA,CAAA,CAAA,CAM1BL,KAAAA,CAAIM,IAAAA,CAAiC,QAGtBN,CAAAA,KAAAA,CAAIO,IAAG,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AAAA,CAAAA,CAAAA,CAAAA,CAAmC5C,EAAA2C,SAAA,CAAA,UAAA,CAAA,IAAA,IAMQL,CAAA,CAAA,CAA3CO,EAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwBhD,EAAA2C,SAAA,CAAA,SAAA,CAAA,IAAA,IAGhDL,CAAA,CAAA,CAAXO,KAAyB7C,CAAA2C,CAAAA,SAAAA,CAAA,YAAA,EAGkBL,CAAAA,CAAAA,CAAAA,CAAA,CAA3CO,CAAS,CAAA,CAAEC,KAAMC,OAASC,CAAAA,OAAAA,CAAAA,CAAS,KAAyBhD,CAAA2C,CAAAA,SAAAA,CAAA,eAAA,EAMhCL,CAAAA,CAAAA,CAAAA,CAAA,CAA5BO,CAAS,CAAA,CAAEG,SAAS,CAAsDhD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2C,UAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAG/BL,EAAA,CAA3CO,CAAAA,CAAS,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,SAAS,CAAqBhD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2C,UAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CA4BzDL,EAAA,CADCW,CAAAA,CAAM,WAAY,CAAEC,oBAAAA,CAAAA,CAAsB,KAG1ClD,CAAA2C,CAAAA,SAAAA,CAAA,uBAAA,IArEU3C,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAesC,EAAA,CAD3Ba,CAAAA,CAAc,sBACFnD"}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var t,_templateObject,e;function _taggedTemplateLiteral(strings,raw){if(!raw){raw=strings.slice(0);}return Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}));}return{setters:[function(_index001CjsJs){t=_index001CjsJs.i;}],execute:function(){_export("s",e=t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n color: var(--color-text-default, #000);\n text-align: center;\n border-radius: 4px;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px; /* 100% */\n letter-spacing: 0.2px;\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n padding: 12px;\n cursor: pointer;\n gap: 10px;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: var(--nile-focus-ring);\n outline-offset: var(--nile-focus-ring-offset);\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* When disabled, prevent mouse events from bubbling up from children */\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__prefix,\n .button__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n pointer-events: none;\n }\n\n .button__label {\n display: inline-block;\n }\n\n .button__label::slotted(nile-icon) {\n vertical-align: -2px;\n }\n\n /* Default */\n .button--default {\n border: 1px solid #c7ced4;\n background: #fff;\n color: black;\n }\n\n .button--default:hover:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--default:active:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--checked {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--has-label.button--medium .button__label {\n padding: 0 var(--nile-spacing-medium);\n }\n\n .button--has-prefix.button--medium {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-prefix.button--medium .button__label {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium,\n .button--caret.button--medium {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium .button__label,\n .button--caret.button--medium .button__label {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .nile-radio-button--first {\n background-color: red;\n }\n\n :host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n :host(.nile-group-button--inner) .button {\n border-radius: 0;\n }\n\n :host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n\n /* All except the first */\n :host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {\n margin-inline-start: calc(-1 * var(--nile-input-border-width));\n }\n\n :host(.nile-radio-button--inner) .button {\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n }\n\n .button__prefix,\n .button__suffix,\n .button__label {\n display: inline-flex;\n position: relative;\n align-items: center;\n }\n\n /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.\n We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */\n .hidden-input {\n all: unset;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n outline: dotted 1px red;\n opacity: 0;\n z-index: -1;\n }\n"]))));}};});
|
2
|
-
//# sourceMappingURL=nile-radio-button.css.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"nile-radio-button.css.cjs.js","sources":["../../../src/nile-radio-button/nile-radio-button.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit-element';\n\n/**\n * RadioButton CSS\n */\nexport const styles = css`\n :host {\n }\n\n .button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n color: var(--color-text-default, #000);\n text-align: center;\n border-radius: 4px;\n font-family: Colfax-regular;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 14px; /* 100% */\n letter-spacing: 0.2px;\n text-decoration: none;\n user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n padding: 12px;\n cursor: pointer;\n gap: 10px;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: var(--nile-focus-ring);\n outline-offset: var(--nile-focus-ring-offset);\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* When disabled, prevent mouse events from bubbling up from children */\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__prefix,\n .button__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n pointer-events: none;\n }\n\n .button__label {\n display: inline-block;\n }\n\n .button__label::slotted(nile-icon) {\n vertical-align: -2px;\n }\n\n /* Default */\n .button--default {\n border: 1px solid #c7ced4;\n background: #fff;\n color: black;\n }\n\n .button--default:hover:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--default:active:not(.button--disabled) {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--checked {\n border: 1px solid #c7ced4;\n background: #e5e9eb;\n }\n\n .button--has-label.button--medium .button__label {\n padding: 0 var(--nile-spacing-medium);\n }\n\n .button--has-prefix.button--medium {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-prefix.button--medium .button__label {\n padding-inline-start: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium,\n .button--caret.button--medium {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .button--has-suffix.button--medium .button__label,\n .button--caret.button--medium .button__label {\n padding-inline-end: var(--nile-spacing-small);\n }\n\n .nile-radio-button--first {\n background-color: red;\n }\n\n :host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n :host(.nile-group-button--inner) .button {\n border-radius: 0;\n }\n\n :host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n\n /* All except the first */\n :host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {\n margin-inline-start: calc(-1 * var(--nile-input-border-width));\n }\n\n :host(.nile-radio-button--inner) .button {\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n }\n\n .button__prefix,\n .button__suffix,\n .button__label {\n display: inline-flex;\n position: relative;\n align-items: center;\n }\n\n /* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.\n We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */\n .hidden-input {\n all: unset;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n outline: dotted 1px red;\n opacity: 0;\n z-index: -1;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -1,161 +0,0 @@
|
|
1
|
-
import{i as t}from"../index-cd2f9c12.esm.js";const e=t`
|
2
|
-
:host {
|
3
|
-
}
|
4
|
-
|
5
|
-
.button {
|
6
|
-
display: inline-flex;
|
7
|
-
align-items: center;
|
8
|
-
justify-content: center;
|
9
|
-
width: 100%;
|
10
|
-
color: var(--color-text-default, #000);
|
11
|
-
text-align: center;
|
12
|
-
border-radius: 4px;
|
13
|
-
font-family: Colfax-regular;
|
14
|
-
font-size: 14px;
|
15
|
-
font-style: normal;
|
16
|
-
font-weight: 400;
|
17
|
-
line-height: 14px; /* 100% */
|
18
|
-
letter-spacing: 0.2px;
|
19
|
-
text-decoration: none;
|
20
|
-
user-select: none;
|
21
|
-
white-space: nowrap;
|
22
|
-
vertical-align: middle;
|
23
|
-
padding: 12px;
|
24
|
-
cursor: pointer;
|
25
|
-
gap: 10px;
|
26
|
-
}
|
27
|
-
|
28
|
-
.button::-moz-focus-inner {
|
29
|
-
border: 0;
|
30
|
-
}
|
31
|
-
|
32
|
-
.button:focus {
|
33
|
-
outline: none;
|
34
|
-
}
|
35
|
-
|
36
|
-
.button:focus-visible {
|
37
|
-
outline: var(--nile-focus-ring);
|
38
|
-
outline-offset: var(--nile-focus-ring-offset);
|
39
|
-
}
|
40
|
-
|
41
|
-
.button--disabled {
|
42
|
-
opacity: 0.5;
|
43
|
-
cursor: not-allowed;
|
44
|
-
}
|
45
|
-
|
46
|
-
/* When disabled, prevent mouse events from bubbling up from children */
|
47
|
-
.button--disabled * {
|
48
|
-
pointer-events: none;
|
49
|
-
}
|
50
|
-
|
51
|
-
.button__prefix,
|
52
|
-
.button__suffix {
|
53
|
-
flex: 0 0 auto;
|
54
|
-
display: flex;
|
55
|
-
align-items: center;
|
56
|
-
pointer-events: none;
|
57
|
-
}
|
58
|
-
|
59
|
-
.button__label {
|
60
|
-
display: inline-block;
|
61
|
-
}
|
62
|
-
|
63
|
-
.button__label::slotted(nile-icon) {
|
64
|
-
vertical-align: -2px;
|
65
|
-
}
|
66
|
-
|
67
|
-
/* Default */
|
68
|
-
.button--default {
|
69
|
-
border: 1px solid #c7ced4;
|
70
|
-
background: #fff;
|
71
|
-
color: black;
|
72
|
-
}
|
73
|
-
|
74
|
-
.button--default:hover:not(.button--disabled) {
|
75
|
-
border: 1px solid #c7ced4;
|
76
|
-
background: #e5e9eb;
|
77
|
-
}
|
78
|
-
|
79
|
-
.button--default:active:not(.button--disabled) {
|
80
|
-
border: 1px solid #c7ced4;
|
81
|
-
background: #e5e9eb;
|
82
|
-
}
|
83
|
-
|
84
|
-
.button--checked {
|
85
|
-
border: 1px solid #c7ced4;
|
86
|
-
background: #e5e9eb;
|
87
|
-
}
|
88
|
-
|
89
|
-
.button--has-label.button--medium .button__label {
|
90
|
-
padding: 0 var(--nile-spacing-medium);
|
91
|
-
}
|
92
|
-
|
93
|
-
.button--has-prefix.button--medium {
|
94
|
-
padding-inline-start: var(--nile-spacing-small);
|
95
|
-
}
|
96
|
-
|
97
|
-
.button--has-prefix.button--medium .button__label {
|
98
|
-
padding-inline-start: var(--nile-spacing-small);
|
99
|
-
}
|
100
|
-
|
101
|
-
.button--has-suffix.button--medium,
|
102
|
-
.button--caret.button--medium {
|
103
|
-
padding-inline-end: var(--nile-spacing-small);
|
104
|
-
}
|
105
|
-
|
106
|
-
.button--has-suffix.button--medium .button__label,
|
107
|
-
.button--caret.button--medium .button__label {
|
108
|
-
padding-inline-end: var(--nile-spacing-small);
|
109
|
-
}
|
110
|
-
|
111
|
-
.nile-radio-button--first {
|
112
|
-
background-color: red;
|
113
|
-
}
|
114
|
-
|
115
|
-
:host(.nile-radio-button--first:not(.nile-radio-button--last)) .button {
|
116
|
-
border-start-end-radius: 0;
|
117
|
-
border-end-end-radius: 0;
|
118
|
-
}
|
119
|
-
|
120
|
-
:host(.nile-group-button--inner) .button {
|
121
|
-
border-radius: 0;
|
122
|
-
}
|
123
|
-
|
124
|
-
:host(.nile-radio-button--last:not(.nile-radio-button--first)) .button {
|
125
|
-
border-start-start-radius: 0;
|
126
|
-
border-end-start-radius: 0;
|
127
|
-
}
|
128
|
-
|
129
|
-
/* All except the first */
|
130
|
-
:host(.nile-radio-button__button:not(.nile-radio-button__button--first)) {
|
131
|
-
margin-inline-start: calc(-1 * var(--nile-input-border-width));
|
132
|
-
}
|
133
|
-
|
134
|
-
:host(.nile-radio-button--inner) .button {
|
135
|
-
border-radius: 0;
|
136
|
-
border-left: 0;
|
137
|
-
border-right: 0;
|
138
|
-
}
|
139
|
-
|
140
|
-
.button__prefix,
|
141
|
-
.button__suffix,
|
142
|
-
.button__label {
|
143
|
-
display: inline-flex;
|
144
|
-
position: relative;
|
145
|
-
align-items: center;
|
146
|
-
}
|
147
|
-
|
148
|
-
/* We use a hidden input so constraint validation errors work, since they don't appear to show when used with buttons.
|
149
|
-
We can't actually hide it, though, otherwise the messages will be suppressed by the browser. */
|
150
|
-
.hidden-input {
|
151
|
-
all: unset;
|
152
|
-
position: absolute;
|
153
|
-
top: 0;
|
154
|
-
left: 0;
|
155
|
-
bottom: 0;
|
156
|
-
right: 0;
|
157
|
-
outline: dotted 1px red;
|
158
|
-
opacity: 0;
|
159
|
-
z-index: -1;
|
160
|
-
}
|
161
|
-
`;export{e as s};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,state as e,customElement as o}from"lit/decorators.js";import{s as l}from"./nile-radio-button.css.esm.js";import{N as r}from"../internal/nile-element.esm.js";import{H as a}from"../slot.esm.js";import{classMap as n}from"lit/directives/class-map.js";import{ifDefined as d}from"lit/directives/if-defined.js";import{w as u}from"../internal/watch.esm.js";import{n as h}from"../property-09139d3c.esm.js";import"lit";let f=class extends r{constructor(){super(...arguments),this.hasSlotController=new a(this,"[default]","prefix","suffix"),this.hasFocus=!1,this.checked=!1,this.disabled=!1,this.size="medium",this.pill=!1}static get styles(){return[l]}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation")}handleBlur(){this.hasFocus=!1,this.emit("nile-blur")}handleClick(t){if(this.disabled)return t.preventDefault(),void t.stopPropagation();this.checked=!0}handleFocus(){this.hasFocus=!0,this.emit("nile-focus")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false")}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){return i`
|
2
|
-
<div part="base" role="presentation">
|
3
|
-
<button
|
4
|
-
part="${"button"+(this.checked?" button--checked":"")}"
|
5
|
-
role="radio"
|
6
|
-
aria-checked="${this.checked}"
|
7
|
-
class=${n({button:!0,"button--default":!0,"button--checked":this.checked,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
|
8
|
-
aria-disabled=${this.disabled}
|
9
|
-
type="button"
|
10
|
-
value=${d(this.value)}
|
11
|
-
tabindex="${this.checked?"0":"-1"}"
|
12
|
-
@blur=${this.handleBlur}
|
13
|
-
@focus=${this.handleFocus}
|
14
|
-
@click=${this.handleClick}
|
15
|
-
>
|
16
|
-
<slot name="prefix" part="prefix" class="button__prefix"></slot>
|
17
|
-
<slot part="label" class="button__label"></slot>
|
18
|
-
<slot name="suffix" part="suffix" class="button__suffix"></slot>
|
19
|
-
</button>
|
20
|
-
</div>
|
21
|
-
`}};t([s(".button")],f.prototype,"input",void 0),t([s(".hidden-input")],f.prototype,"hiddenInput",void 0),t([e()],f.prototype,"hasFocus",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"checked",void 0),t([h()],f.prototype,"value",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([h({reflect:!0})],f.prototype,"size",void 0),t([h({type:Boolean,reflect:!0})],f.prototype,"pill",void 0),t([u("disabled",{waitUntilFirstUpdate:!0})],f.prototype,"handleDisabledChange",null),f=t([o("nile-radio-button")],f);export{f as N};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register(["./nile-radio-button-group.cjs.js","tslib","lit/directives/class-map.js","lit/decorators.js","../internal/slot.cjs.js","lit","../internal/watch.cjs.js","../internal/nile-element.cjs.js","./nile-radio-button-group.css.cjs.js","../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileRadioButtonGroupCjsJs){_export("NileRadioButtonGroup",_nileRadioButtonGroupCjsJs.N);},function(_tslib){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalSlotCjsJs){},function(_lit){},function(_internalWatchCjsJs){},function(_internalNileElementCjsJs){},function(_nileRadioButtonGroupCssCjsJs){},function(_index001CjsJs){}],execute:function(){}};});
|
2
|
-
//# sourceMappingURL=index.cjs.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
export{N as NileRadioButtonGroup}from"./nile-radio-button-group.esm.js";import"tslib";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/slot.esm.js";import"lit";import"../internal/watch.esm.js";import"../internal/nile-element.esm.js";import"./nile-radio-button-group.css.esm.js";import"../index-cd2f9c12.esm.js";
|