diff --git a/package-lock.json b/package-lock.json index 5e8cea9..2cdcd6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1030,56 +1030,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", - "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@jridgewell/set-array": "^1.2.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.24" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/set-array": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", - "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", - "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" - } - }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -1087,18 +1037,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.25", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", - "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, "node_modules/@keyv/bigmap": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@keyv/bigmap/-/bigmap-1.0.3.tgz", @@ -2938,14 +2876,6 @@ "node": ">=8" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT", - "optional": true - }, "node_modules/cacheable": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cacheable/-/cacheable-2.1.0.tgz", @@ -3041,14 +2971,6 @@ "dev": true, "license": "MIT" }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true, - "license": "MIT", - "optional": true - }, "node_modules/compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", @@ -5460,18 +5382,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/src/assets/scss/components/_listbox.scss b/src/assets/scss/components/_listbox.scss new file mode 100644 index 0000000..abb0806 --- /dev/null +++ b/src/assets/scss/components/_listbox.scss @@ -0,0 +1,95 @@ +/* @docs */ +/* @docs */ + +/* @bootstrap docs */ +// $list-group-color: var(--#{$prefix}body-color); +// $list-group-bg: var(--#{$prefix}body-bg); +// $list-group-border-color: var(--#{$prefix}border-color); +// $list-group-border-width: var(--#{$prefix}border-width); +// $list-group-border-radius: var(--#{$prefix}border-radius); + +// $list-group-item-padding-y: $spacer * .5; +// $list-group-item-padding-x: $spacer; +// // fusv-disable +// $list-group-item-bg-scale: -80%; // Deprecated in v5.3.0 +// $list-group-item-color-scale: 40%; // Deprecated in v5.3.0 +// // fusv-enable + +// $list-group-hover-bg: var(--#{$prefix}tertiary-bg); +// $list-group-active-color: $component-active-color; +// $list-group-active-bg: $component-active-bg; +// $list-group-active-border-color: $list-group-active-bg; + +// $list-group-disabled-color: var(--#{$prefix}secondary-color); +// $list-group-disabled-bg: $list-group-bg; + +// $list-group-action-color: var(--#{$prefix}secondary-color); +// $list-group-action-hover-color: var(--#{$prefix}emphasis-color); + +// $list-group-action-active-color: var(--#{$prefix}body-color); +// $list-group-action-active-bg: var(--#{$prefix}secondary-bg); +/* @bootstrap docs */ + +.listbox { + position: relative; + border: var(--#{$prefix}list-group-border-width) solid + var(--#{$prefix}list-group-border-color); + + .list-group-item { + border-width: 0 0 var(--#{$prefix}list-group-border-width); + } + + > .list-group-item:last-child { + border-bottom: unset; + } + + .list-group-list { + margin: 0; + padding: 0; + overflow: auto; + position: relative; + border-radius: inherit; + + &:not(:first-child) { + &, + > .list-group-item:first-child { + border-top-left-radius: unset; + border-top-right-radius: unset; + } + } + + &:not(:last-child) { + &, + > .list-group-item:last-child { + border-bottom-left-radius: unset; + border-bottom-right-radius: unset; + } + } + + &:last-child { + > .list-group-item:last-child { + border-bottom: unset; + } + } + } + + &.selectable { + .list-group-list .list-group-item { + cursor: pointer; + + &.focused, + &:hover { + &:not(.active) { + color: var(--#{$prefix}list-group-action-hover-color); + background-color: var( + --#{$prefix}list-group-action-hover-bg + ); + } + + &.active { + filter: brightness(95%); + } + } + } + } +} diff --git a/src/assets/scss/theme.scss b/src/assets/scss/theme.scss index fa18431..04f85a4 100644 --- a/src/assets/scss/theme.scss +++ b/src/assets/scss/theme.scss @@ -22,6 +22,7 @@ @import "components/field"; @import "components/icon"; @import "components/input"; +@import "components/listbox"; @import "components/loading"; @import "components/menu"; @import "components/modal"; diff --git a/src/components.ts b/src/components.ts index 80d2b2c..5c86246 100644 --- a/src/components.ts +++ b/src/components.ts @@ -12,6 +12,7 @@ export default [ "Field", "Icon", "Input", + "Listbox", "Loading", "Menu", "Modal", diff --git a/src/plugins/theme.ts b/src/plugins/theme.ts index 816b56d..1628c71 100644 --- a/src/plugins/theme.ts +++ b/src/plugins/theme.ts @@ -252,6 +252,22 @@ const bootstrapConfig: OrugaOptions = { iconRightClass: "icon-right", counterClass: "help counter", }, + listbox: { + override: true, + rootClass: "listbox list-group", + selectableClass: "selectable", + filterableClass: "filterable", + disabledClass: "disabled", + headerClass: "list-group-header list-group-item", + filterClass: "list-group-filter list-group-item", + footerClass: "list-group-footer list-group-item", + emptyClass: "list-group-empty list-group-item", + listClass: "list-group-list", + itemClass: "list-group-item", + itemSelectedClass: "active", + itemFocusedClass: "focused", + itemDisabledClass: "disabled", + }, loading: { override: true, rootClass: "loading",