@aotearoan/neon 23.2.5 → 23.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/common/enums/NeonFunctionalColor.cjs.js +1 -1
  2. package/dist/common/enums/NeonFunctionalColor.cjs.js.map +1 -1
  3. package/dist/common/enums/NeonFunctionalColor.es.js +1 -1
  4. package/dist/common/enums/NeonFunctionalColor.es.js.map +1 -1
  5. package/dist/components/user-input/number/NeonNumber.cjs.js +1 -1
  6. package/dist/components/user-input/number/NeonNumber.cjs.js.map +1 -1
  7. package/dist/components/user-input/number/NeonNumber.es.js +13 -9
  8. package/dist/components/user-input/number/NeonNumber.es.js.map +1 -1
  9. package/dist/components/user-input/number/NeonNumber.vue.cjs.js +1 -1
  10. package/dist/components/user-input/number/NeonNumber.vue.cjs.js.map +1 -1
  11. package/dist/components/user-input/number/NeonNumber.vue.es.js +7 -6
  12. package/dist/components/user-input/number/NeonNumber.vue.es.js.map +1 -1
  13. package/dist/src/common/enums/NeonFunctionalColor.d.ts +2 -0
  14. package/dist/src/components/user-input/number/NeonNumber.d.ts +85 -104
  15. package/package.json +1 -1
  16. package/src/sass/color-variables.scss +11 -0
  17. package/src/sass/components/_button.scss +4 -1
  18. package/src/sass/components/_date-picker.scss +2 -0
  19. package/src/sass/components/_menu.scss +17 -10
  20. package/src/sass/components/_mobile-menu.scss +6 -6
  21. package/src/sass/components/_select.scss +2 -0
  22. package/src/sass/components/_stepper.scss +0 -7
  23. package/src/sass/global/_base-html.scss +4 -0
  24. package/src/sass/global/_typography.scss +4 -0
  25. package/src/sass/includes/_palettes.scss +2 -0
  26. package/src/sass/palette.scss +10 -0
  27. package/src/sass/theme.scss +1 -0
  28. package/src/sass/variables.scss +41 -6
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s=(r=>(r.LowContrast="low-contrast",r.Neutral="neutral",r.HighContrast="high-contrast",r.Brand="brand",r.Primary="primary",r.Info="info",r.Success="success",r.Warn="warn",r.Error="error",r))(s||{});exports.NeonFunctionalColor=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var s=(r=>(r.LowContrast="low-contrast",r.Neutral="neutral",r.HighContrast="high-contrast",r.Brand="brand",r.Accent="accent",r.Primary="primary",r.Info="info",r.Success="success",r.Warn="warn",r.Error="error",r))(s||{});exports.NeonFunctionalColor=s;
2
2
  //# sourceMappingURL=NeonFunctionalColor.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonFunctionalColor.cjs.js","sources":["../../../src/common/enums/NeonFunctionalColor.ts"],"sourcesContent":["/**\n * The core color palettes available for styling components in Neon. See the design section\n * <a href=\"/design/color\">Color</a> page for more details on color palettes.\n */\nexport enum NeonFunctionalColor {\n /** Low contrast is a more subtle neutral palette which can be used for secondary actions & supporting text. */\n LowContrast = 'low-contrast',\n /** Neutral is the base greyscale palette. */\n Neutral = 'neutral',\n /**\n * High contrast is a higher contrast palette than can be used for increased accessibility or for a stronger black &\n * white application.\n * */\n HighContrast = 'high-contrast',\n /** Brand is the main brand color palette, this is useful for branded CTAs, text & controls. */\n Brand = 'brand',\n /** Primary is the main application color palette. For most applications this will be used by default. */\n Primary = 'primary',\n /** Info can be used to convey informational context, e.g. notes & alerts */\n Info = 'info',\n /** Success can be used to convey successful actions. */\n Success = 'success',\n /** Warn can be used to convey issues/actions that are less severe but may still impact the user. */\n Warn = 'warn',\n /** Error can be used to convey issues/actions that are severe & that the user may not be able to recover from. */\n Error = 'error',\n}\n"],"names":["NeonFunctionalColor"],"mappings":"gFAIO,IAAKA,GAAAA,IAEVA,EAAA,YAAc,eAEdA,EAAA,QAAU,UAKVA,EAAA,aAAe,gBAEfA,EAAA,MAAQ,QAERA,EAAA,QAAU,UAEVA,EAAA,KAAO,OAEPA,EAAA,QAAU,UAEVA,EAAA,KAAO,OAEPA,EAAA,MAAQ,QArBEA,IAAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"NeonFunctionalColor.cjs.js","sources":["../../../src/common/enums/NeonFunctionalColor.ts"],"sourcesContent":["/**\n * The core color palettes available for styling components in Neon. See the design section\n * <a href=\"/design/color\">Color</a> page for more details on color palettes.\n */\nexport enum NeonFunctionalColor {\n /** Low contrast is a more subtle neutral palette which can be used for secondary actions & supporting text. */\n LowContrast = 'low-contrast',\n /** Neutral is the base greyscale palette. */\n Neutral = 'neutral',\n /**\n * High contrast is a higher contrast palette than can be used for increased accessibility or for a stronger black &\n * white application.\n * */\n HighContrast = 'high-contrast',\n /** Brand is the main brand color palette, this is useful for branded CTAs, text & controls. */\n Brand = 'brand',\n /** Accent is an alternative brand accent palette used when multiple brand colors are required */\n Accent = 'accent',\n /** Primary is the main application color palette. For most applications this will be used by default. */\n Primary = 'primary',\n /** Info can be used to convey informational context, e.g. notes & alerts */\n Info = 'info',\n /** Success can be used to convey successful actions. */\n Success = 'success',\n /** Warn can be used to convey issues/actions that are less severe but may still impact the user. */\n Warn = 'warn',\n /** Error can be used to convey issues/actions that are severe & that the user may not be able to recover from. */\n Error = 'error',\n}\n"],"names":["NeonFunctionalColor"],"mappings":"gFAIO,IAAKA,GAAAA,IAEVA,EAAA,YAAc,eAEdA,EAAA,QAAU,UAKVA,EAAA,aAAe,gBAEfA,EAAA,MAAQ,QAERA,EAAA,OAAS,SAETA,EAAA,QAAU,UAEVA,EAAA,KAAO,OAEPA,EAAA,QAAU,UAEVA,EAAA,KAAO,OAEPA,EAAA,MAAQ,QAvBEA,IAAAA,GAAA,CAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- var s = /* @__PURE__ */ ((r) => (r.LowContrast = "low-contrast", r.Neutral = "neutral", r.HighContrast = "high-contrast", r.Brand = "brand", r.Primary = "primary", r.Info = "info", r.Success = "success", r.Warn = "warn", r.Error = "error", r))(s || {});
1
+ var s = /* @__PURE__ */ ((r) => (r.LowContrast = "low-contrast", r.Neutral = "neutral", r.HighContrast = "high-contrast", r.Brand = "brand", r.Accent = "accent", r.Primary = "primary", r.Info = "info", r.Success = "success", r.Warn = "warn", r.Error = "error", r))(s || {});
2
2
  export {
3
3
  s as NeonFunctionalColor
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NeonFunctionalColor.es.js","sources":["../../../src/common/enums/NeonFunctionalColor.ts"],"sourcesContent":["/**\n * The core color palettes available for styling components in Neon. See the design section\n * <a href=\"/design/color\">Color</a> page for more details on color palettes.\n */\nexport enum NeonFunctionalColor {\n /** Low contrast is a more subtle neutral palette which can be used for secondary actions & supporting text. */\n LowContrast = 'low-contrast',\n /** Neutral is the base greyscale palette. */\n Neutral = 'neutral',\n /**\n * High contrast is a higher contrast palette than can be used for increased accessibility or for a stronger black &\n * white application.\n * */\n HighContrast = 'high-contrast',\n /** Brand is the main brand color palette, this is useful for branded CTAs, text & controls. */\n Brand = 'brand',\n /** Primary is the main application color palette. For most applications this will be used by default. */\n Primary = 'primary',\n /** Info can be used to convey informational context, e.g. notes & alerts */\n Info = 'info',\n /** Success can be used to convey successful actions. */\n Success = 'success',\n /** Warn can be used to convey issues/actions that are less severe but may still impact the user. */\n Warn = 'warn',\n /** Error can be used to convey issues/actions that are severe & that the user may not be able to recover from. */\n Error = 'error',\n}\n"],"names":["NeonFunctionalColor"],"mappings":"AAIO,IAAKA,sBAAAA,OAEVA,EAAA,cAAc,gBAEdA,EAAA,UAAU,WAKVA,EAAA,eAAe,iBAEfA,EAAA,QAAQ,SAERA,EAAA,UAAU,WAEVA,EAAA,OAAO,QAEPA,EAAA,UAAU,WAEVA,EAAA,OAAO,QAEPA,EAAA,QAAQ,SArBEA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"NeonFunctionalColor.es.js","sources":["../../../src/common/enums/NeonFunctionalColor.ts"],"sourcesContent":["/**\n * The core color palettes available for styling components in Neon. See the design section\n * <a href=\"/design/color\">Color</a> page for more details on color palettes.\n */\nexport enum NeonFunctionalColor {\n /** Low contrast is a more subtle neutral palette which can be used for secondary actions & supporting text. */\n LowContrast = 'low-contrast',\n /** Neutral is the base greyscale palette. */\n Neutral = 'neutral',\n /**\n * High contrast is a higher contrast palette than can be used for increased accessibility or for a stronger black &\n * white application.\n * */\n HighContrast = 'high-contrast',\n /** Brand is the main brand color palette, this is useful for branded CTAs, text & controls. */\n Brand = 'brand',\n /** Accent is an alternative brand accent palette used when multiple brand colors are required */\n Accent = 'accent',\n /** Primary is the main application color palette. For most applications this will be used by default. */\n Primary = 'primary',\n /** Info can be used to convey informational context, e.g. notes & alerts */\n Info = 'info',\n /** Success can be used to convey successful actions. */\n Success = 'success',\n /** Warn can be used to convey issues/actions that are less severe but may still impact the user. */\n Warn = 'warn',\n /** Error can be used to convey issues/actions that are severe & that the user may not be able to recover from. */\n Error = 'error',\n}\n"],"names":["NeonFunctionalColor"],"mappings":"AAIO,IAAKA,sBAAAA,OAEVA,EAAA,cAAc,gBAEdA,EAAA,UAAU,WAKVA,EAAA,eAAe,iBAEfA,EAAA,QAAQ,SAERA,EAAA,SAAS,UAETA,EAAA,UAAU,WAEVA,EAAA,OAAO,QAEPA,EAAA,UAAU,WAEVA,EAAA,OAAO,QAEPA,EAAA,QAAQ,SAvBEA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,2 +1,2 @@
1
- "use strict";const u=require("vue"),g=require("../../../common/enums/NeonFunctionalColor.cjs.js"),q=require("../../../common/enums/NeonSize.cjs.js"),S=require("../../../common/enums/NeonInputMode.cjs.js"),F=require("../button/NeonButton.vue.cjs.js"),B=require("../field-group/NeonFieldGroup.vue.cjs.js"),x=require("../input/NeonInput.vue.cjs.js"),s=require("../../../common/utils/NeonNumberUtils.cjs.js"),M=u.defineComponent({name:"NeonNumber",components:{NeonButton:F,NeonFieldGroup:B,NeonInput:x},props:{modelValue:{type:Number,default:null},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1},color:{type:String,default:g.NeonFunctionalColor.Primary},size:{type:String,default:q.NeonSize.Medium},locale:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},spinButtons:{type:Boolean,default:!1},percentage:{type:Boolean,default:!1},decimals:{type:Number,required:!1},valueTemplate:{type:String,required:!1},inputmode:{type:String,default:S.NeonInputMode.Numeric},incrementLabel:{type:String,default:"Increment"},decrementLabel:{type:String,default:"Decrement"}},emits:["update:modelValue"],setup(e,{emit:f}){const N=u.useAttrs(),o=u.ref(!1),r=t=>{e.disabled||f("update:modelValue",t)},v=u.computed(()=>{const{onBlur:t,onFocus:n,...m}=N;return m}),V=t=>{const n=s.NeonNumberUtils.parseNumber(t),m=t!==""&&t!==null?Math.max(Math.min(n,e.max??Number.MAX_SAFE_INTEGER),e.min??Number.MIN_SAFE_INTEGER):null;(m===null||!isNaN(n))&&r(m)},l=u.computed(()=>e.decimals??(e.percentage?0:void 0)),a=u.computed(()=>e.percentage&&l.value!==void 0?l.value+2:l.value),i=u.computed(()=>{const t=e.modelValue!==null?+e.modelValue:e.min||0;return a.value!==void 0?Number(t.toFixed(a.value)):t}),b=u.computed(()=>e.modelValue!==null&&(e.valueTemplate!==void 0||l.value!==void 0||e.percentage!==void 0)?s.NeonNumberUtils.formatNumber(e.modelValue,{decimals:l.value,format:e.valueTemplate,percentage:e.percentage},e.locale):e.modelValue),d=u.computed(()=>{var t;return a.value?(t=e.modelValue)==null?void 0:t.toFixed(a.value):e.modelValue}),y=u.computed(()=>o.value?d.value?`${d.value}`:"":b.value),c=u.computed(()=>e.step??(e.percentage?.01:1));return{focus:o,sanitizedAttributes:v,computedDecimals:l,computedRawDecimals:a,computedValue:i,computedStep:c,displayValue:y,valueChanged:V,increment:()=>{const t=i.value+c.value,n=e.max!==void 0?Math.min(e.max,t):t;n!==e.modelValue&&r(n)},decrement:()=>{const t=i.value-c.value,n=e.min!==void 0?Math.max(e.min,t):t;n!==e.modelValue&&r(n)},onFocus:()=>o.value=!0,onBlur:()=>o.value=!1}}});module.exports=M;
1
+ "use strict";const u=require("vue"),g=require("../../../common/enums/NeonFunctionalColor.cjs.js"),S=require("../../../common/enums/NeonSize.cjs.js"),q=require("../../../common/enums/NeonInputMode.cjs.js"),F=require("../button/NeonButton.vue.cjs.js"),B=require("../field-group/NeonFieldGroup.vue.cjs.js"),p=require("../input/NeonInput.vue.cjs.js"),s=require("../../../common/utils/NeonNumberUtils.cjs.js"),x=u.defineComponent({name:"NeonNumber",components:{NeonButton:F,NeonFieldGroup:B,NeonInput:p},props:{id:{type:String,default:null},modelValue:{type:Number,default:null},min:{type:Number,required:!1},max:{type:Number,required:!1},step:{type:Number,required:!1},color:{type:String,default:g.NeonFunctionalColor.Primary},size:{type:String,default:S.NeonSize.Medium},locale:{type:String,default:null},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},spinButtons:{type:Boolean,default:!1},percentage:{type:Boolean,default:!1},decimals:{type:Number,required:!1},valueTemplate:{type:String,required:!1},inputmode:{type:String,default:q.NeonInputMode.Numeric},incrementLabel:{type:String,default:"Increment"},decrementLabel:{type:String,default:"Decrement"}},emits:["update:modelValue"],setup(e,{emit:f}){const N=u.useAttrs(),o=u.ref(!1),r=t=>{e.disabled||f("update:modelValue",t)},v=u.computed(()=>{const{onBlur:t,onFocus:n,...i}=N;return i}),V=t=>{const n=s.NeonNumberUtils.parseNumber(t),i=t!==""&&t!==null?Math.max(Math.min(n,e.max??Number.MAX_SAFE_INTEGER),e.min??Number.MIN_SAFE_INTEGER):null;(i===null||!isNaN(n))&&r(i)},l=u.computed(()=>e.decimals??(e.percentage?0:void 0)),a=u.computed(()=>e.percentage&&l.value!==void 0?l.value+2:l.value),m=u.computed(()=>{const t=e.modelValue!==null?+e.modelValue:e.min||0;return a.value!==void 0?Number(t.toFixed(a.value)):t}),b=u.computed(()=>e.modelValue!==null&&(e.valueTemplate!==void 0||l.value!==void 0||e.percentage!==void 0)?s.NeonNumberUtils.formatNumber(e.modelValue,{decimals:l.value,format:e.valueTemplate,percentage:e.percentage},e.locale):e.modelValue),c=u.computed(()=>{var t;return a.value?(t=e.modelValue)==null?void 0:t.toFixed(a.value):e.modelValue}),y=u.computed(()=>o.value?c.value?`${c.value}`:"":b.value),d=u.computed(()=>e.step??(e.percentage?.01:1));return{focus:o,sanitizedAttributes:v,computedDecimals:l,computedRawDecimals:a,computedValue:m,computedStep:d,displayValue:y,valueChanged:V,increment:()=>{const t=m.value+d.value,n=e.max!==void 0?Math.min(e.max,t):t;n!==e.modelValue&&r(n)},decrement:()=>{const t=m.value-d.value,n=e.min!==void 0?Math.max(e.min,t):t;n!==e.modelValue&&r(n)},onFocus:()=>o.value=!0,onBlur:()=>o.value=!1}}});module.exports=x;
2
2
  //# sourceMappingURL=NeonNumber.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonNumber.cjs.js","sources":["../../../../src/components/user-input/number/NeonNumber.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonFieldGroup from '@/components/user-input/field-group/NeonFieldGroup.vue';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport { NeonNumberUtils } from '@/common/utils/NeonNumberUtils';\n\n/**\n * <p>\n * The <strong>NeonNumber</strong> component is the equivalent of an <strong>&lt;input type=\"number\" /&gt;</strong>\n * with -/+ spin buttons. In addition, it supports formatting as a percentage or with a provided custom template and\n * also pasting of values in the user's locale, e.g. 6,543.12.\n * </p>\n * <p><strong>NeonNumber</strong> supports all the properties found on an HTML &lt;input&gt;.</p>\n */\nexport default defineComponent({\n name: 'NeonNumber',\n components: {\n NeonButton,\n NeonFieldGroup,\n NeonInput,\n },\n props: {\n /**\n * The value of the number input. Either a valid number or null.\n */\n modelValue: { type: Number, default: null },\n /**\n * The minimum value the input can accept.\n */\n min: { type: Number, required: false },\n /**\n * The maximum value the input can accept.\n */\n max: { type: Number, required: false },\n /**\n * The step value for the spin buttons.\n */\n step: { type: Number, required: false },\n /**\n * The component color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The component size.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The locale used for display purposes. This defaults to the browser's locale if none is provided.\n */\n locale: { type: String, default: null },\n /**\n * Placeholder text to display in the input\n */\n placeholder: { type: String, default: null },\n /**\n * Whether the component is disabled.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Enable/disable direct editing of the value.\n */\n editable: { type: Boolean, default: true },\n /**\n * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.\n */\n spinButtons: { type: Boolean, default: false },\n /**\n * Automatically applies % formatting, e.g. if the value = 0.15 it will be displayed as 15%.\n */\n percentage: { type: Boolean, default: false },\n /**\n * The rounding precision for display formatting.\n */\n decimals: { type: Number, required: false },\n /**\n * A template string used for formatting the value for display. Use the placeholder {value} to reference the value in\n * the template string. e.g. value = 90, ${value} => $90.\n */\n valueTemplate: { type: String, required: false },\n /**\n * The HTML inputmode of the component. Either 'numeric' or 'decimal'.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Numeric },\n /**\n * ARIA label for the increment spinner button.\n */\n incrementLabel: { type: String, default: 'Increment' },\n /**\n * ARIA label for the decrement spinner button.\n */\n decrementLabel: { type: String, default: 'Decrement' },\n },\n emits: [\n /**\n * Emitted when the user changes the value of the number via the increment/decrement buttons or manually entering\n * the value.\n * @type {number | null} the current value or null if the value has been cleared.\n */\n 'update:modelValue',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const focus = ref(false);\n\n const emitValue = (value: number | null) => {\n if (!props.disabled) {\n emit('update:modelValue', value);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onBlur, onFocus, ...sanitized } = attrs;\n return sanitized;\n });\n\n const valueChanged = (value: string) => {\n const parsedValue = NeonNumberUtils.parseNumber(value);\n const newValue =\n value !== '' && value !== null\n ? Math.max(Math.min(parsedValue, props.max ?? Number.MAX_SAFE_INTEGER), props.min ?? Number.MIN_SAFE_INTEGER)\n : null;\n if (newValue === null || !isNaN(parsedValue)) {\n emitValue(newValue);\n }\n };\n\n const computedDecimals = computed(() => {\n return props.decimals ?? (props.percentage ? 0 : undefined);\n });\n\n const computedRawDecimals = computed(() => {\n return props.percentage && computedDecimals.value !== undefined\n ? computedDecimals.value + 2\n : computedDecimals.value;\n });\n\n const computedValue = computed(() => {\n const newValue = props.modelValue !== null ? +props.modelValue : props.min || 0;\n return computedRawDecimals.value !== undefined ? Number(newValue.toFixed(computedRawDecimals.value)) : newValue;\n });\n\n const formattedValue = computed(() => {\n return props.modelValue !== null &&\n (props.valueTemplate !== undefined || computedDecimals.value !== undefined || props.percentage !== undefined)\n ? NeonNumberUtils.formatNumber(\n props.modelValue,\n {\n decimals: computedDecimals.value,\n format: props.valueTemplate,\n percentage: props.percentage,\n },\n props.locale,\n )\n : props.modelValue;\n });\n\n const rawValue = computed(() => {\n return computedRawDecimals.value ? props.modelValue?.toFixed(computedRawDecimals.value) : props.modelValue;\n });\n\n const displayValue = computed(() => {\n return focus.value ? (rawValue.value ? `${rawValue.value}` : '') : formattedValue.value;\n });\n\n const computedStep = computed(() => {\n return props.step ?? (props.percentage ? 0.01 : 1);\n });\n\n const decrement = () => {\n const newValue = computedValue.value - computedStep.value;\n const emittedValue = props.min !== undefined ? Math.max(props.min, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const increment = () => {\n const newValue = computedValue.value + computedStep.value;\n const emittedValue = props.max !== undefined ? Math.min(props.max, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const onFocus = () => (focus.value = true);\n const onBlur = () => (focus.value = false);\n\n return {\n focus,\n sanitizedAttributes,\n computedDecimals,\n computedRawDecimals,\n computedValue,\n computedStep,\n displayValue,\n valueChanged,\n increment,\n decrement,\n onFocus,\n onBlur,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonFieldGroup","NeonInput","NeonFunctionalColor","NeonSize","NeonInputMode","props","emit","attrs","useAttrs","focus","ref","emitValue","value","sanitizedAttributes","computed","onBlur","onFocus","sanitized","valueChanged","parsedValue","NeonNumberUtils","newValue","computedDecimals","computedRawDecimals","computedValue","formattedValue","rawValue","_a","displayValue","computedStep","emittedValue"],"mappings":"qZAiBAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,WAAAC,EACA,eAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAIL,WAAY,CAAE,KAAM,OAAQ,QAAS,IAAA,EAIrC,IAAK,CAAE,KAAM,OAAQ,SAAU,EAAA,EAI/B,IAAK,CAAE,KAAM,OAAQ,SAAU,EAAA,EAI/B,KAAM,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIhC,MAAO,CAAE,KAAM,OAAqC,QAASC,EAAAA,oBAAoB,OAAA,EAIjF,KAAM,CAAE,KAAM,OAA0B,QAASC,EAAAA,SAAS,MAAA,EAI1D,OAAQ,CAAE,KAAM,OAAQ,QAAS,IAAA,EAIjC,YAAa,CAAE,KAAM,OAAQ,QAAS,IAAA,EAItC,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,SAAU,CAAE,KAAM,QAAS,QAAS,EAAA,EAIpC,YAAa,CAAE,KAAM,QAAS,QAAS,EAAA,EAIvC,WAAY,CAAE,KAAM,QAAS,QAAS,EAAA,EAItC,SAAU,CAAE,KAAM,OAAQ,SAAU,EAAA,EAKpC,cAAe,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIzC,UAAW,CAAE,KAAM,OAA+B,QAASC,EAAAA,cAAc,OAAA,EAIzE,eAAgB,CAAE,KAAM,OAAQ,QAAS,WAAA,EAI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YA,EAAM,UAAA,EAEpBA,EAAM,MAAA,EAERA,EAAM,UACX,EAEKqB,EAAWZ,EAAAA,SAAS,IAAM,OAC9B,OAAOS,EAAoB,OAAQI,EAAAtB,EAAM,aAAN,YAAAsB,EAAkB,QAAQJ,EAAoB,OAASlB,EAAM,UAClG,CAAC,EAEKuB,EAAed,EAAAA,SAAS,IACrBL,EAAM,MAASiB,EAAS,MAAQ,GAAGA,EAAS,KAAK,GAAK,GAAMD,EAAe,KACnF,EAEKI,EAAef,EAAAA,SAAS,IACrBT,EAAM,OAASA,EAAM,WAAa,IAAO,EACjD,EAqBD,MAAO,CACL,MAAAI,EACA,oBAAAI,EACA,iBAAAS,EACA,oBAAAC,EACA,cAAAC,EACA,aAAAK,EACA,aAAAD,EACA,aAAAV,EACA,UApBgB,IAAM,CACtB,MAAMG,EAAWG,EAAc,MAAQK,EAAa,MAC9CC,EAAezB,EAAM,MAAQ,OAAY,KAAK,IAAIA,EAAM,IAAKgB,CAAQ,EAAIA,EAC3ES,IAAiBzB,EAAM,YACzBM,EAAUmB,CAAY,CAE1B,EAeE,UA7BgB,IAAM,CACtB,MAAMT,EAAWG,EAAc,MAAQK,EAAa,MAC9CC,EAAezB,EAAM,MAAQ,OAAY,KAAK,IAAIA,EAAM,IAAKgB,CAAQ,EAAIA,EAC3ES,IAAiBzB,EAAM,YACzBM,EAAUmB,CAAY,CAE1B,EAwBE,QAdc,IAAOrB,EAAM,MAAQ,GAenC,OAda,IAAOA,EAAM,MAAQ,EAclC,CAEJ,CACF,CAAC"}
1
+ {"version":3,"file":"NeonNumber.cjs.js","sources":["../../../../src/components/user-input/number/NeonNumber.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonFieldGroup from '@/components/user-input/field-group/NeonFieldGroup.vue';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport { NeonNumberUtils } from '@/common/utils/NeonNumberUtils';\n\n/**\n * <p>\n * The <strong>NeonNumber</strong> component is the equivalent of an <strong>&lt;input type=\"number\" /&gt;</strong>\n * with -/+ spin buttons. In addition, it supports formatting as a percentage or with a provided custom template and\n * also pasting of values in the user's locale, e.g. 6,543.12.\n * </p>\n * <p><strong>NeonNumber</strong> supports all the properties found on an HTML &lt;input&gt;.</p>\n */\nexport default defineComponent({\n name: 'NeonNumber',\n components: {\n NeonButton,\n NeonFieldGroup,\n NeonInput,\n },\n props: {\n /**\n * The id the input\n */\n id: { type: String, default: null },\n /**\n * The value of the number input. Either a valid number or null.\n */\n modelValue: { type: Number, default: null },\n /**\n * The minimum value the input can accept.\n */\n min: { type: Number, required: false },\n /**\n * The maximum value the input can accept.\n */\n max: { type: Number, required: false },\n /**\n * The step value for the spin buttons.\n */\n step: { type: Number, required: false },\n /**\n * The component color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The component size.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The locale used for display purposes. This defaults to the browser's locale if none is provided.\n */\n locale: { type: String, default: null },\n /**\n * Placeholder text to display in the input\n */\n placeholder: { type: String, default: null },\n /**\n * Whether the component is disabled.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Enable/disable direct editing of the value.\n */\n editable: { type: Boolean, default: true },\n /**\n * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.\n */\n spinButtons: { type: Boolean, default: false },\n /**\n * Automatically applies % formatting, e.g. if the value = 0.15 it will be displayed as 15%.\n */\n percentage: { type: Boolean, default: false },\n /**\n * The rounding precision for display formatting.\n */\n decimals: { type: Number, required: false },\n /**\n * A template string used for formatting the value for display. Use the placeholder {value} to reference the value in\n * the template string. e.g. value = 90, ${value} => $90.\n */\n valueTemplate: { type: String, required: false },\n /**\n * The HTML inputmode of the component. Either 'numeric' or 'decimal'.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Numeric },\n /**\n * ARIA label for the increment spinner button.\n */\n incrementLabel: { type: String, default: 'Increment' },\n /**\n * ARIA label for the decrement spinner button.\n */\n decrementLabel: { type: String, default: 'Decrement' },\n },\n emits: [\n /**\n * Emitted when the user changes the value of the number via the increment/decrement buttons or manually entering\n * the value.\n * @type {number | null} the current value or null if the value has been cleared.\n */\n 'update:modelValue',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const focus = ref(false);\n\n const emitValue = (value: number | null) => {\n if (!props.disabled) {\n emit('update:modelValue', value);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onBlur, onFocus, ...sanitized } = attrs;\n return sanitized;\n });\n\n const valueChanged = (value: string) => {\n const parsedValue = NeonNumberUtils.parseNumber(value);\n const newValue =\n value !== '' && value !== null\n ? Math.max(Math.min(parsedValue, props.max ?? Number.MAX_SAFE_INTEGER), props.min ?? Number.MIN_SAFE_INTEGER)\n : null;\n if (newValue === null || !isNaN(parsedValue)) {\n emitValue(newValue);\n }\n };\n\n const computedDecimals = computed(() => {\n return props.decimals ?? (props.percentage ? 0 : undefined);\n });\n\n const computedRawDecimals = computed(() => {\n return props.percentage && computedDecimals.value !== undefined\n ? computedDecimals.value + 2\n : computedDecimals.value;\n });\n\n const computedValue = computed(() => {\n const newValue = props.modelValue !== null ? +props.modelValue : props.min || 0;\n return computedRawDecimals.value !== undefined ? Number(newValue.toFixed(computedRawDecimals.value)) : newValue;\n });\n\n const formattedValue = computed(() => {\n return props.modelValue !== null &&\n (props.valueTemplate !== undefined || computedDecimals.value !== undefined || props.percentage !== undefined)\n ? NeonNumberUtils.formatNumber(\n props.modelValue,\n {\n decimals: computedDecimals.value,\n format: props.valueTemplate,\n percentage: props.percentage,\n },\n props.locale,\n )\n : props.modelValue;\n });\n\n const rawValue = computed(() => {\n return computedRawDecimals.value ? props.modelValue?.toFixed(computedRawDecimals.value) : props.modelValue;\n });\n\n const displayValue = computed(() => {\n return focus.value ? (rawValue.value ? `${rawValue.value}` : '') : formattedValue.value;\n });\n\n const computedStep = computed(() => {\n return props.step ?? (props.percentage ? 0.01 : 1);\n });\n\n const decrement = () => {\n const newValue = computedValue.value - computedStep.value;\n const emittedValue = props.min !== undefined ? Math.max(props.min, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const increment = () => {\n const newValue = computedValue.value + computedStep.value;\n const emittedValue = props.max !== undefined ? Math.min(props.max, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const onFocus = () => (focus.value = true);\n const onBlur = () => (focus.value = false);\n\n return {\n focus,\n sanitizedAttributes,\n computedDecimals,\n computedRawDecimals,\n computedValue,\n computedStep,\n displayValue,\n valueChanged,\n increment,\n decrement,\n onFocus,\n onBlur,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonFieldGroup","NeonInput","NeonFunctionalColor","NeonSize","NeonInputMode","props","emit","attrs","useAttrs","focus","ref","emitValue","value","sanitizedAttributes","computed","onBlur","onFocus","sanitized","valueChanged","parsedValue","NeonNumberUtils","newValue","computedDecimals","computedRawDecimals","computedValue","formattedValue","rawValue","_a","displayValue","computedStep","emittedValue"],"mappings":"qZAiBAA,EAAeC,kBAAgB,CAC7B,KAAM,aACN,WAAY,CACV,WAAAC,EACA,eAAAC,EACA,UAAAC,CAAA,EAEF,MAAO,CAIL,GAAI,CAAE,KAAM,OAAQ,QAAS,IAAA,EAI7B,WAAY,CAAE,KAAM,OAAQ,QAAS,IAAA,EAIrC,IAAK,CAAE,KAAM,OAAQ,SAAU,EAAA,EAI/B,IAAK,CAAE,KAAM,OAAQ,SAAU,EAAA,EAI/B,KAAM,CAAE,KAAM,OAAQ,SAAU,EAAA,EAIhC,MAAO,CAAE,KAA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7BgB,IAAM,CACtB,MAAMT,EAAWG,EAAc,MAAQK,EAAa,MAC9CC,EAAezB,EAAM,MAAQ,OAAY,KAAK,IAAIA,EAAM,IAAKgB,CAAQ,EAAIA,EAC3ES,IAAiBzB,EAAM,YACzBM,EAAUmB,CAAY,CAE1B,EAwBE,QAdc,IAAOrB,EAAM,MAAQ,GAenC,OAda,IAAOA,EAAM,MAAQ,EAclC,CAEJ,CACF,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as g, useAttrs as S, ref as B, computed as a } from "vue";
2
2
  import { NeonFunctionalColor as F } from "../../../common/enums/NeonFunctionalColor.es.js";
3
- import { NeonSize as x } from "../../../common/enums/NeonSize.es.js";
4
- import { NeonInputMode as p } from "../../../common/enums/NeonInputMode.es.js";
3
+ import { NeonSize as p } from "../../../common/enums/NeonSize.es.js";
4
+ import { NeonInputMode as x } from "../../../common/enums/NeonInputMode.es.js";
5
5
  import M from "../button/NeonButton.vue.es.js";
6
6
  import h from "../field-group/NeonFieldGroup.vue.es.js";
7
7
  import w from "../input/NeonInput.vue.es.js";
8
- import { NeonNumberUtils as s } from "../../../common/utils/NeonNumberUtils.es.js";
8
+ import { NeonNumberUtils as f } from "../../../common/utils/NeonNumberUtils.es.js";
9
9
  const P = g({
10
10
  name: "NeonNumber",
11
11
  components: {
@@ -14,6 +14,10 @@ const P = g({
14
14
  NeonInput: w
15
15
  },
16
16
  props: {
17
+ /**
18
+ * The id the input
19
+ */
20
+ id: { type: String, default: null },
17
21
  /**
18
22
  * The value of the number input. Either a valid number or null.
19
23
  */
@@ -37,7 +41,7 @@ const P = g({
37
41
  /**
38
42
  * The component size.
39
43
  */
40
- size: { type: String, default: x.Medium },
44
+ size: { type: String, default: p.Medium },
41
45
  /**
42
46
  * The locale used for display purposes. This defaults to the browser's locale if none is provided.
43
47
  */
@@ -74,7 +78,7 @@ const P = g({
74
78
  /**
75
79
  * The HTML inputmode of the component. Either 'numeric' or 'decimal'.
76
80
  */
77
- inputmode: { type: String, default: p.Numeric },
81
+ inputmode: { type: String, default: x.Numeric },
78
82
  /**
79
83
  * ARIA label for the increment spinner button.
80
84
  */
@@ -92,19 +96,19 @@ const P = g({
92
96
  */
93
97
  "update:modelValue"
94
98
  ],
95
- setup(e, { emit: f }) {
99
+ setup(e, { emit: s }) {
96
100
  const v = S(), o = B(!1), r = (t) => {
97
- e.disabled || f("update:modelValue", t);
101
+ e.disabled || s("update:modelValue", t);
98
102
  }, N = a(() => {
99
103
  const { onBlur: t, onFocus: l, ...m } = v;
100
104
  return m;
101
105
  }), V = (t) => {
102
- const l = s.parseNumber(t), m = t !== "" && t !== null ? Math.max(Math.min(l, e.max ?? Number.MAX_SAFE_INTEGER), e.min ?? Number.MIN_SAFE_INTEGER) : null;
106
+ const l = f.parseNumber(t), m = t !== "" && t !== null ? Math.max(Math.min(l, e.max ?? Number.MAX_SAFE_INTEGER), e.min ?? Number.MIN_SAFE_INTEGER) : null;
103
107
  (m === null || !isNaN(l)) && r(m);
104
108
  }, u = a(() => e.decimals ?? (e.percentage ? 0 : void 0)), n = a(() => e.percentage && u.value !== void 0 ? u.value + 2 : u.value), i = a(() => {
105
109
  const t = e.modelValue !== null ? +e.modelValue : e.min || 0;
106
110
  return n.value !== void 0 ? Number(t.toFixed(n.value)) : t;
107
- }), y = a(() => e.modelValue !== null && (e.valueTemplate !== void 0 || u.value !== void 0 || e.percentage !== void 0) ? s.formatNumber(
111
+ }), y = a(() => e.modelValue !== null && (e.valueTemplate !== void 0 || u.value !== void 0 || e.percentage !== void 0) ? f.formatNumber(
108
112
  e.modelValue,
109
113
  {
110
114
  decimals: u.value,
@@ -1 +1 @@
1
- {"version":3,"file":"NeonNumber.es.js","sources":["../../../../src/components/user-input/number/NeonNumber.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonFieldGroup from '@/components/user-input/field-group/NeonFieldGroup.vue';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport { NeonNumberUtils } from '@/common/utils/NeonNumberUtils';\n\n/**\n * <p>\n * The <strong>NeonNumber</strong> component is the equivalent of an <strong>&lt;input type=\"number\" /&gt;</strong>\n * with -/+ spin buttons. In addition, it supports formatting as a percentage or with a provided custom template and\n * also pasting of values in the user's locale, e.g. 6,543.12.\n * </p>\n * <p><strong>NeonNumber</strong> supports all the properties found on an HTML &lt;input&gt;.</p>\n */\nexport default defineComponent({\n name: 'NeonNumber',\n components: {\n NeonButton,\n NeonFieldGroup,\n NeonInput,\n },\n props: {\n /**\n * The value of the number input. Either a valid number or null.\n */\n modelValue: { type: Number, default: null },\n /**\n * The minimum value the input can accept.\n */\n min: { type: Number, required: false },\n /**\n * The maximum value the input can accept.\n */\n max: { type: Number, required: false },\n /**\n * The step value for the spin buttons.\n */\n step: { type: Number, required: false },\n /**\n * The component color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The component size.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The locale used for display purposes. This defaults to the browser's locale if none is provided.\n */\n locale: { type: String, default: null },\n /**\n * Placeholder text to display in the input\n */\n placeholder: { type: String, default: null },\n /**\n * Whether the component is disabled.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Enable/disable direct editing of the value.\n */\n editable: { type: Boolean, default: true },\n /**\n * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.\n */\n spinButtons: { type: Boolean, default: false },\n /**\n * Automatically applies % formatting, e.g. if the value = 0.15 it will be displayed as 15%.\n */\n percentage: { type: Boolean, default: false },\n /**\n * The rounding precision for display formatting.\n */\n decimals: { type: Number, required: false },\n /**\n * A template string used for formatting the value for display. Use the placeholder {value} to reference the value in\n * the template string. e.g. value = 90, ${value} => $90.\n */\n valueTemplate: { type: String, required: false },\n /**\n * The HTML inputmode of the component. Either 'numeric' or 'decimal'.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Numeric },\n /**\n * ARIA label for the increment spinner button.\n */\n incrementLabel: { type: String, default: 'Increment' },\n /**\n * ARIA label for the decrement spinner button.\n */\n decrementLabel: { type: String, default: 'Decrement' },\n },\n emits: [\n /**\n * Emitted when the user changes the value of the number via the increment/decrement buttons or manually entering\n * the value.\n * @type {number | null} the current value or null if the value has been cleared.\n */\n 'update:modelValue',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const focus = ref(false);\n\n const emitValue = (value: number | null) => {\n if (!props.disabled) {\n emit('update:modelValue', value);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onBlur, onFocus, ...sanitized } = attrs;\n return sanitized;\n });\n\n const valueChanged = (value: string) => {\n const parsedValue = NeonNumberUtils.parseNumber(value);\n const newValue =\n value !== '' && value !== null\n ? Math.max(Math.min(parsedValue, props.max ?? Number.MAX_SAFE_INTEGER), props.min ?? Number.MIN_SAFE_INTEGER)\n : null;\n if (newValue === null || !isNaN(parsedValue)) {\n emitValue(newValue);\n }\n };\n\n const computedDecimals = computed(() => {\n return props.decimals ?? (props.percentage ? 0 : undefined);\n });\n\n const computedRawDecimals = computed(() => {\n return props.percentage && computedDecimals.value !== undefined\n ? computedDecimals.value + 2\n : computedDecimals.value;\n });\n\n const computedValue = computed(() => {\n const newValue = props.modelValue !== null ? +props.modelValue : props.min || 0;\n return computedRawDecimals.value !== undefined ? Number(newValue.toFixed(computedRawDecimals.value)) : newValue;\n });\n\n const formattedValue = computed(() => {\n return props.modelValue !== null &&\n (props.valueTemplate !== undefined || computedDecimals.value !== undefined || props.percentage !== undefined)\n ? NeonNumberUtils.formatNumber(\n props.modelValue,\n {\n decimals: computedDecimals.value,\n format: props.valueTemplate,\n percentage: props.percentage,\n },\n props.locale,\n )\n : props.modelValue;\n });\n\n const rawValue = computed(() => {\n return computedRawDecimals.value ? props.modelValue?.toFixed(computedRawDecimals.value) : props.modelValue;\n });\n\n const displayValue = computed(() => {\n return focus.value ? (rawValue.value ? `${rawValue.value}` : '') : formattedValue.value;\n });\n\n const computedStep = computed(() => {\n return props.step ?? (props.percentage ? 0.01 : 1);\n });\n\n const decrement = () => {\n const newValue = computedValue.value - computedStep.value;\n const emittedValue = props.min !== undefined ? Math.max(props.min, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const increment = () => {\n const newValue = computedValue.value + computedStep.value;\n const emittedValue = props.max !== undefined ? Math.min(props.max, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const onFocus = () => (focus.value = true);\n const onBlur = () => (focus.value = false);\n\n return {\n focus,\n sanitizedAttributes,\n computedDecimals,\n computedRawDecimals,\n computedValue,\n computedStep,\n displayValue,\n valueChanged,\n increment,\n decrement,\n onFocus,\n onBlur,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonFieldGroup","NeonInput","NeonFunctionalColor","NeonSize","NeonInputMode","props","emit","attrs","useAttrs","focus","ref","emitValue","value","sanitizedAttributes","computed","onBlur","onFocus","sanitized","valueChanged","parsedValue","NeonNumberUtils","newValue","computedDecimals","computedRawDecimals","computedValue","formattedValue","rawValue","_a","displayValue","computedStep","emittedValue"],"mappings":";;;;;;;;AAiBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,YAAY,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAIrC,KAAK,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;AAAA;AAAA;AAA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EAAoB,SAASlB,EAAM;AAAA,IAClG,CAAC,GAEKuB,IAAed,EAAS,MACrBL,EAAM,QAASiB,EAAS,QAAQ,GAAGA,EAAS,KAAK,KAAK,KAAMD,EAAe,KACnF,GAEKI,IAAef,EAAS,MACrBT,EAAM,SAASA,EAAM,aAAa,OAAO,EACjD;AAqBD,WAAO;AAAA,MACL,OAAAI;AAAA,MACA,qBAAAI;AAAA,MACA,kBAAAS;AAAA,MACA,qBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAK;AAAA,MACA,cAAAD;AAAA,MACA,cAAAV;AAAA,MACA,WApBgB,MAAM;AACtB,cAAMG,IAAWG,EAAc,QAAQK,EAAa,OAC9CC,IAAezB,EAAM,QAAQ,SAAY,KAAK,IAAIA,EAAM,KAAKgB,CAAQ,IAAIA;AAC/E,QAAIS,MAAiBzB,EAAM,cACzBM,EAAUmB,CAAY;AAAA,MAE1B;AAAA,MAeE,WA7BgB,MAAM;AACtB,cAAMT,IAAWG,EAAc,QAAQK,EAAa,OAC9CC,IAAezB,EAAM,QAAQ,SAAY,KAAK,IAAIA,EAAM,KAAKgB,CAAQ,IAAIA;AAC/E,QAAIS,MAAiBzB,EAAM,cACzBM,EAAUmB,CAAY;AAAA,MAE1B;AAAA,MAwBE,SAdc,MAAOrB,EAAM,QAAQ;AAAA,MAenC,QAda,MAAOA,EAAM,QAAQ;AAAA,IAclC;AAAA,EAEJ;AACF,CAAC;"}
1
+ {"version":3,"file":"NeonNumber.es.js","sources":["../../../../src/components/user-input/number/NeonNumber.ts?vue&type=script&src=true&lang.ts"],"sourcesContent":["import { computed, defineComponent, ref, useAttrs } from 'vue';\nimport { NeonFunctionalColor } from '@/common/enums/NeonFunctionalColor';\nimport { NeonSize } from '@/common/enums/NeonSize';\nimport { NeonInputMode } from '@/common/enums/NeonInputMode';\nimport NeonButton from '@/components/user-input/button/NeonButton.vue';\nimport NeonFieldGroup from '@/components/user-input/field-group/NeonFieldGroup.vue';\nimport NeonInput from '@/components/user-input/input/NeonInput.vue';\nimport { NeonNumberUtils } from '@/common/utils/NeonNumberUtils';\n\n/**\n * <p>\n * The <strong>NeonNumber</strong> component is the equivalent of an <strong>&lt;input type=\"number\" /&gt;</strong>\n * with -/+ spin buttons. In addition, it supports formatting as a percentage or with a provided custom template and\n * also pasting of values in the user's locale, e.g. 6,543.12.\n * </p>\n * <p><strong>NeonNumber</strong> supports all the properties found on an HTML &lt;input&gt;.</p>\n */\nexport default defineComponent({\n name: 'NeonNumber',\n components: {\n NeonButton,\n NeonFieldGroup,\n NeonInput,\n },\n props: {\n /**\n * The id the input\n */\n id: { type: String, default: null },\n /**\n * The value of the number input. Either a valid number or null.\n */\n modelValue: { type: Number, default: null },\n /**\n * The minimum value the input can accept.\n */\n min: { type: Number, required: false },\n /**\n * The maximum value the input can accept.\n */\n max: { type: Number, required: false },\n /**\n * The step value for the spin buttons.\n */\n step: { type: Number, required: false },\n /**\n * The component color.\n */\n color: { type: String as () => NeonFunctionalColor, default: NeonFunctionalColor.Primary },\n /**\n * The component size.\n */\n size: { type: String as () => NeonSize, default: NeonSize.Medium },\n /**\n * The locale used for display purposes. This defaults to the browser's locale if none is provided.\n */\n locale: { type: String, default: null },\n /**\n * Placeholder text to display in the input\n */\n placeholder: { type: String, default: null },\n /**\n * Whether the component is disabled.\n */\n disabled: { type: Boolean, default: false },\n /**\n * Enable/disable direct editing of the value.\n */\n editable: { type: Boolean, default: true },\n /**\n * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.\n */\n spinButtons: { type: Boolean, default: false },\n /**\n * Automatically applies % formatting, e.g. if the value = 0.15 it will be displayed as 15%.\n */\n percentage: { type: Boolean, default: false },\n /**\n * The rounding precision for display formatting.\n */\n decimals: { type: Number, required: false },\n /**\n * A template string used for formatting the value for display. Use the placeholder {value} to reference the value in\n * the template string. e.g. value = 90, ${value} => $90.\n */\n valueTemplate: { type: String, required: false },\n /**\n * The HTML inputmode of the component. Either 'numeric' or 'decimal'.\n */\n inputmode: { type: String as () => NeonInputMode, default: NeonInputMode.Numeric },\n /**\n * ARIA label for the increment spinner button.\n */\n incrementLabel: { type: String, default: 'Increment' },\n /**\n * ARIA label for the decrement spinner button.\n */\n decrementLabel: { type: String, default: 'Decrement' },\n },\n emits: [\n /**\n * Emitted when the user changes the value of the number via the increment/decrement buttons or manually entering\n * the value.\n * @type {number | null} the current value or null if the value has been cleared.\n */\n 'update:modelValue',\n ],\n setup(props, { emit }) {\n const attrs = useAttrs();\n const focus = ref(false);\n\n const emitValue = (value: number | null) => {\n if (!props.disabled) {\n emit('update:modelValue', value);\n }\n };\n\n const sanitizedAttributes = computed(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { onBlur, onFocus, ...sanitized } = attrs;\n return sanitized;\n });\n\n const valueChanged = (value: string) => {\n const parsedValue = NeonNumberUtils.parseNumber(value);\n const newValue =\n value !== '' && value !== null\n ? Math.max(Math.min(parsedValue, props.max ?? Number.MAX_SAFE_INTEGER), props.min ?? Number.MIN_SAFE_INTEGER)\n : null;\n if (newValue === null || !isNaN(parsedValue)) {\n emitValue(newValue);\n }\n };\n\n const computedDecimals = computed(() => {\n return props.decimals ?? (props.percentage ? 0 : undefined);\n });\n\n const computedRawDecimals = computed(() => {\n return props.percentage && computedDecimals.value !== undefined\n ? computedDecimals.value + 2\n : computedDecimals.value;\n });\n\n const computedValue = computed(() => {\n const newValue = props.modelValue !== null ? +props.modelValue : props.min || 0;\n return computedRawDecimals.value !== undefined ? Number(newValue.toFixed(computedRawDecimals.value)) : newValue;\n });\n\n const formattedValue = computed(() => {\n return props.modelValue !== null &&\n (props.valueTemplate !== undefined || computedDecimals.value !== undefined || props.percentage !== undefined)\n ? NeonNumberUtils.formatNumber(\n props.modelValue,\n {\n decimals: computedDecimals.value,\n format: props.valueTemplate,\n percentage: props.percentage,\n },\n props.locale,\n )\n : props.modelValue;\n });\n\n const rawValue = computed(() => {\n return computedRawDecimals.value ? props.modelValue?.toFixed(computedRawDecimals.value) : props.modelValue;\n });\n\n const displayValue = computed(() => {\n return focus.value ? (rawValue.value ? `${rawValue.value}` : '') : formattedValue.value;\n });\n\n const computedStep = computed(() => {\n return props.step ?? (props.percentage ? 0.01 : 1);\n });\n\n const decrement = () => {\n const newValue = computedValue.value - computedStep.value;\n const emittedValue = props.min !== undefined ? Math.max(props.min, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const increment = () => {\n const newValue = computedValue.value + computedStep.value;\n const emittedValue = props.max !== undefined ? Math.min(props.max, newValue) : newValue;\n if (emittedValue !== props.modelValue) {\n emitValue(emittedValue);\n }\n };\n\n const onFocus = () => (focus.value = true);\n const onBlur = () => (focus.value = false);\n\n return {\n focus,\n sanitizedAttributes,\n computedDecimals,\n computedRawDecimals,\n computedValue,\n computedStep,\n displayValue,\n valueChanged,\n increment,\n decrement,\n onFocus,\n onBlur,\n };\n },\n});\n"],"names":["_sfc_main","defineComponent","NeonButton","NeonFieldGroup","NeonInput","NeonFunctionalColor","NeonSize","NeonInputMode","props","emit","attrs","useAttrs","focus","ref","emitValue","value","sanitizedAttributes","computed","onBlur","onFocus","sanitized","valueChanged","parsedValue","NeonNumberUtils","newValue","computedDecimals","computedRawDecimals","computedValue","formattedValue","rawValue","_a","displayValue","computedStep","emittedValue"],"mappings":";;;;;;;;AAiBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,YAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,WAAAC;AAAA,EAAA;AAAA,EAEF,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAI,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAI7B,YAAY,EAAE,MAAM,QAAQ,SAAS,KAAA;AAAA;AAAA;AAAA;AAAA,IAIrC,KAAK,EAAE,MAAM,QAAQ,UAAU,GAAA;AAAA;AAAA;AAAA;AAAA,IAI/B,KAAK,EAAE,MAAM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IAClG,CAAC,GAEKuB,IAAed,EAAS,MACrBL,EAAM,QAASiB,EAAS,QAAQ,GAAGA,EAAS,KAAK,KAAK,KAAMD,EAAe,KACnF,GAEKI,IAAef,EAAS,MACrBT,EAAM,SAASA,EAAM,aAAa,OAAO,EACjD;AAqBD,WAAO;AAAA,MACL,OAAAI;AAAA,MACA,qBAAAI;AAAA,MACA,kBAAAS;AAAA,MACA,qBAAAC;AAAA,MACA,eAAAC;AAAA,MACA,cAAAK;AAAA,MACA,cAAAD;AAAA,MACA,cAAAV;AAAA,MACA,WApBgB,MAAM;AACtB,cAAMG,IAAWG,EAAc,QAAQK,EAAa,OAC9CC,IAAezB,EAAM,QAAQ,SAAY,KAAK,IAAIA,EAAM,KAAKgB,CAAQ,IAAIA;AAC/E,QAAIS,MAAiBzB,EAAM,cACzBM,EAAUmB,CAAY;AAAA,MAE1B;AAAA,MAeE,WA7BgB,MAAM;AACtB,cAAMT,IAAWG,EAAc,QAAQK,EAAa,OAC9CC,IAAezB,EAAM,QAAQ,SAAY,KAAK,IAAIA,EAAM,KAAKgB,CAAQ,IAAIA;AAC/E,QAAIS,MAAiBzB,EAAM,cACzBM,EAAUmB,CAAY;AAAA,MAE1B;AAAA,MAwBE,SAdc,MAAOrB,EAAM,QAAQ;AAAA,MAenC,QAda,MAAOA,EAAM,QAAQ;AAAA,IAclC;AAAA,EAEJ;AACF,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";const s=require("./NeonNumber.cjs.js"),n=require("vue"),u=require("../../../_virtual/_plugin-vue_export-helper.cjs.js");function d(e,o,m,p,b,v){const i=n.resolveComponent("neon-button"),r=n.resolveComponent("neon-input"),a=n.resolveComponent("neon-field-group");return n.openBlock(),n.createBlock(a,{class:n.normalizeClass([[`neon-number--${e.size}`,`neon-number--${e.color}`,{"neon-number--disabled":e.disabled,"neon-number--editable":e.editable,"neon-number--with-buttons":e.spinButtons}],"neon-number"]),"indicator-style":"external"},{default:n.withCtx(()=>[e.spinButtons?(n.openBlock(),n.createBlock(i,{key:0,"aria-label":e.decrementLabel,color:e.color,disabled:e.disabled||e.min!==void 0&&e.min===e.modelValue,size:e.size,"button-style":"outline",class:"neon-number__decrement",icon:"minus",onClick:o[0]||(o[0]=l=>e.decrement())},null,8,["aria-label","color","disabled","size"])):n.createCommentVNode("",!0),n.createVNode(r,n.mergeProps({"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":e.modelValue,color:e.color,disabled:e.disabled||!e.editable,inputmode:e.inputmode,max:e.max,min:e.min,"model-value":e.displayValue,placeholder:e.placeholder,size:e.size,step:e.computedStep,class:"neon-number__input",role:"spinbutton",type:"text"},e.sanitizedAttributes,{onBlur:o[1]||(o[1]=l=>e.onBlur()),onFocus:o[2]||(o[2]=l=>e.onFocus()),"onUpdate:modelValue":e.valueChanged,onKeydown:[o[3]||(o[3]=n.withKeys(n.withModifiers(l=>e.increment(),["prevent"]),["up"])),o[4]||(o[4]=n.withKeys(n.withModifiers(l=>e.decrement(),["prevent"]),["down"]))]}),null,16,["aria-valuemax","aria-valuemin","aria-valuenow","color","disabled","inputmode","max","min","model-value","placeholder","size","step","onUpdate:modelValue"]),e.spinButtons?(n.openBlock(),n.createBlock(i,{key:1,"aria-label":e.incrementLabel,color:e.color,disabled:e.disabled||e.max!==void 0&&e.max===e.modelValue,size:e.size,"button-style":"outline",class:"neon-number__increment",icon:"plus",onClick:o[5]||(o[5]=l=>e.increment())},null,8,["aria-label","color","disabled","size"])):n.createCommentVNode("",!0)]),_:1},8,["class"])}const t=u(s,[["render",d]]);module.exports=t;
1
+ "use strict";const s=require("./NeonNumber.cjs.js"),n=require("vue"),u=require("../../../_virtual/_plugin-vue_export-helper.cjs.js");function d(e,o,m,p,b,v){const i=n.resolveComponent("neon-button"),r=n.resolveComponent("neon-input"),a=n.resolveComponent("neon-field-group");return n.openBlock(),n.createBlock(a,{class:n.normalizeClass([[`neon-number--${e.size}`,`neon-number--${e.color}`,{"neon-number--disabled":e.disabled,"neon-number--editable":e.editable,"neon-number--with-buttons":e.spinButtons}],"neon-number"]),"indicator-style":"external"},{default:n.withCtx(()=>[e.spinButtons?(n.openBlock(),n.createBlock(i,{key:0,"aria-label":e.decrementLabel,color:e.color,disabled:e.disabled||e.min!==void 0&&e.min===e.modelValue,size:e.size,"button-style":"outline",class:"neon-number__decrement",icon:"minus",onClick:o[0]||(o[0]=l=>e.decrement())},null,8,["aria-label","color","disabled","size"])):n.createCommentVNode("",!0),n.createVNode(r,n.mergeProps({id:e.id,"aria-valuemax":e.max,"aria-valuemin":e.min,"aria-valuenow":e.modelValue,color:e.color,disabled:e.disabled||!e.editable,inputmode:e.inputmode,max:e.max,min:e.min,"model-value":e.displayValue,placeholder:e.placeholder,size:e.size,step:e.computedStep,class:"neon-number__input",role:"spinbutton",type:"text"},e.sanitizedAttributes,{onBlur:o[1]||(o[1]=l=>e.onBlur()),onFocus:o[2]||(o[2]=l=>e.onFocus()),"onUpdate:modelValue":e.valueChanged,onKeydown:[o[3]||(o[3]=n.withKeys(n.withModifiers(l=>e.increment(),["prevent"]),["up"])),o[4]||(o[4]=n.withKeys(n.withModifiers(l=>e.decrement(),["prevent"]),["down"]))]}),null,16,["id","aria-valuemax","aria-valuemin","aria-valuenow","color","disabled","inputmode","max","min","model-value","placeholder","size","step","onUpdate:modelValue"]),e.spinButtons?(n.openBlock(),n.createBlock(i,{key:1,"aria-label":e.incrementLabel,color:e.color,disabled:e.disabled||e.max!==void 0&&e.max===e.modelValue,size:e.size,"button-style":"outline",class:"neon-number__increment",icon:"plus",onClick:o[5]||(o[5]=l=>e.increment())},null,8,["aria-label","color","disabled","size"])):n.createCommentVNode("",!0)]),_:1},8,["class"])}const t=u(s,[["render",d]]);module.exports=t;
2
2
  //# sourceMappingURL=NeonNumber.vue.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NeonNumber.vue.cjs.js","sources":["../../../../src/components/user-input/number/NeonNumber.vue"],"sourcesContent":["<template>\n <neon-field-group\n :class=\"[\n `neon-number--${size}`,\n `neon-number--${color}`,\n {\n 'neon-number--disabled': disabled,\n 'neon-number--editable': editable,\n 'neon-number--with-buttons': spinButtons,\n },\n ]\"\n class=\"neon-number\"\n indicator-style=\"external\"\n >\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"decrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (min !== undefined && min === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__decrement\"\n icon=\"minus\"\n @click=\"decrement()\"\n />\n <neon-input\n :aria-valuemax=\"max\"\n :aria-valuemin=\"min\"\n :aria-valuenow=\"modelValue\"\n :color=\"color\"\n :disabled=\"disabled || !editable\"\n :inputmode=\"inputmode\"\n :max=\"max\"\n :min=\"min\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :step=\"computedStep\"\n class=\"neon-number__input\"\n role=\"spinbutton\"\n type=\"text\"\n v-bind=\"sanitizedAttributes\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @update:modelValue=\"valueChanged\"\n @keydown.up.prevent=\"increment()\"\n @keydown.down.prevent=\"decrement()\"\n />\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"incrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (max !== undefined && max === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__increment\"\n icon=\"plus\"\n @click=\"increment()\"\n />\n </neon-field-group>\n</template>\n\n<script lang=\"ts\" src=\"./NeonNumber.ts\" />\n"],"names":["_createBlock","_component_neon_field_group","_normalizeClass","_ctx","_component_neon_button","_createVNode","_component_neon_input","_mergeProps"],"mappings":"wSACEA,EAAAA,YA0DmBC,EAAA,CAzDhB,MAAKC,EAAAA,eAAA,CAAA,iBAA0BC,EAAA,IAAI,mBAA0BA,EAAA,KAAK,4BAA6CA,EAAA,iCAA2CA,EAAA,qCAA+CA,EAAA,cASpM,aAAa,CAAA,EACnB,kBAAgB,+BAEhB,IAUE,CATMA,EAAA,2BADRH,EAAAA,YAUEI,EAAA,OARC,aAAYD,EAAA,eACZ,MAAOA,EAAA,MACP,SAAUA,YAAaA,EAAA,MAAQ,QAAaA,EAAA,MAAQA,EAAA,WACpD,KAAMA,EAAA,KACP,eAAa,UACb,MAAM,yBACN,KAAK,QACJ,uBAAOA,EAAA,4FAEVE,EAAAA,YAsBEC,EAtBFC,aAsBE,CArBC,gBAAeJ,EAAA,IACf,gBAAeA,EAAA,IACf,gBAAeA,EAAA,WACf,MAAOA,EAAA,MACP,SAAUA,EAAA,UAAQ,CAAKA,EAAA,SACvB,UAAWA,EAAA,UACX,IAAKA,EAAA,IACL,IAAKA,EAAA,IACL,cAAaA,EAAA,aACb,YAAaA,EAAA,YACb,KAAMA,EAAA,KACN,KAAMA,EAAA,aACP,MAAM,qBACN,KAAK,aACL,KAAK,QACGA,EAAA,oBAAmB,CAC1B,sBAAMA,EAAA,OAAM,GACZ,uBAAOA,EAAA,QAAO,GACd,sBAAmBA,EAAA,aACnB,UAAO,2CAAaA,EAAA,UAAS,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,IAAA,CAAA,6CACPA,EAAA,UAAS,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,MAAA,CAAA,4KAG1BA,EAAA,2BADRH,EAAAA,YAUEI,EAAA,OARC,aAAYD,EAAA,eACZ,MAAOA,EAAA,MACP,SAAUA,YAAaA,EAAA,MAAQ,QAAaA,EAAA,MAAQA,EAAA,WACpD,KAAMA,EAAA,KACP,eAAa,UACb,MAAM,yBACN,KAAK,OACJ,uBAAOA,EAAA"}
1
+ {"version":3,"file":"NeonNumber.vue.cjs.js","sources":["../../../../src/components/user-input/number/NeonNumber.vue"],"sourcesContent":["<template>\n <neon-field-group\n :class=\"[\n `neon-number--${size}`,\n `neon-number--${color}`,\n {\n 'neon-number--disabled': disabled,\n 'neon-number--editable': editable,\n 'neon-number--with-buttons': spinButtons,\n },\n ]\"\n class=\"neon-number\"\n indicator-style=\"external\"\n >\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"decrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (min !== undefined && min === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__decrement\"\n icon=\"minus\"\n @click=\"decrement()\"\n />\n <neon-input\n :id=\"id\"\n :aria-valuemax=\"max\"\n :aria-valuemin=\"min\"\n :aria-valuenow=\"modelValue\"\n :color=\"color\"\n :disabled=\"disabled || !editable\"\n :inputmode=\"inputmode\"\n :max=\"max\"\n :min=\"min\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :step=\"computedStep\"\n class=\"neon-number__input\"\n role=\"spinbutton\"\n type=\"text\"\n v-bind=\"sanitizedAttributes\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @update:modelValue=\"valueChanged\"\n @keydown.up.prevent=\"increment()\"\n @keydown.down.prevent=\"decrement()\"\n />\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"incrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (max !== undefined && max === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__increment\"\n icon=\"plus\"\n @click=\"increment()\"\n />\n </neon-field-group>\n</template>\n\n<script lang=\"ts\" src=\"./NeonNumber.ts\" />\n"],"names":["_createBlock","_component_neon_field_group","_normalizeClass","_ctx","_component_neon_button","_createVNode","_component_neon_input","_mergeProps"],"mappings":"wSACEA,EAAAA,YA2DmBC,EAAA,CA1DhB,MAAKC,EAAAA,eAAA,CAAA,iBAA0BC,EAAA,IAAI,mBAA0BA,EAAA,KAAK,4BAA6CA,EAAA,iCAA2CA,EAAA,qCAA+CA,EAAA,cASpM,aAAa,CAAA,EACnB,kBAAgB,+BAEhB,IAUE,CATMA,EAAA,2BADRH,EAAAA,YAUEI,EAAA,OARC,aAAYD,EAAA,eACZ,MAAOA,EAAA,MACP,SAAUA,YAAaA,EAAA,MAAQ,QAAaA,EAAA,MAAQA,EAAA,WACpD,KAAMA,EAAA,KACP,eAAa,UACb,MAAM,yBACN,KAAK,QACJ,uBAAOA,EAAA,4FAEVE,EAAAA,YAuBEC,EAvBFC,aAuBE,CAtBC,GAAIJ,EAAA,GACJ,gBAAeA,EAAA,IACf,gBAAeA,EAAA,IACf,gBAAeA,EAAA,WACf,MAAOA,EAAA,MACP,SAAUA,EAAA,UAAQ,CAAKA,EAAA,SACvB,UAAWA,EAAA,UACX,IAAKA,EAAA,IACL,IAAKA,EAAA,IACL,cAAaA,EAAA,aACb,YAAaA,EAAA,YACb,KAAMA,EAAA,KACN,KAAMA,EAAA,aACP,MAAM,qBACN,KAAK,aACL,KAAK,QACGA,EAAA,oBAAmB,CAC1B,sBAAMA,EAAA,OAAM,GACZ,uBAAOA,EAAA,QAAO,GACd,sBAAmBA,EAAA,aACnB,UAAO,2CAAaA,EAAA,UAAS,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,IAAA,CAAA,6CACPA,EAAA,UAAS,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,MAAA,CAAA,iLAG1BA,EAAA,2BADRH,EAAAA,YAUEI,EAAA,OARC,aAAYD,EAAA,eACZ,MAAOA,EAAA,MACP,SAAUA,YAAaA,EAAA,MAAQ,QAAaA,EAAA,MAAQA,EAAA,WACpD,KAAMA,EAAA,KACP,eAAa,UACb,MAAM,yBACN,KAAK,OACJ,uBAAOA,EAAA"}
@@ -1,5 +1,5 @@
1
1
  import p from "./NeonNumber.es.js";
2
- import { resolveComponent as l, openBlock as i, createBlock as a, normalizeClass as b, withCtx as v, createCommentVNode as s, createVNode as f, mergeProps as z, withKeys as d, withModifiers as u } from "vue";
2
+ import { resolveComponent as l, openBlock as i, createBlock as a, normalizeClass as b, withCtx as v, createCommentVNode as d, createVNode as f, mergeProps as z, withKeys as s, withModifiers as u } from "vue";
3
3
  import $ from "../../../_virtual/_plugin-vue_export-helper.es.js";
4
4
  function y(e, n, w, V, B, C) {
5
5
  const r = l("neon-button"), m = l("neon-input"), t = l("neon-field-group");
@@ -26,8 +26,9 @@ function y(e, n, w, V, B, C) {
26
26
  class: "neon-number__decrement",
27
27
  icon: "minus",
28
28
  onClick: n[0] || (n[0] = (o) => e.decrement())
29
- }, null, 8, ["aria-label", "color", "disabled", "size"])) : s("", !0),
29
+ }, null, 8, ["aria-label", "color", "disabled", "size"])) : d("", !0),
30
30
  f(m, z({
31
+ id: e.id,
31
32
  "aria-valuemax": e.max,
32
33
  "aria-valuemin": e.min,
33
34
  "aria-valuenow": e.modelValue,
@@ -48,10 +49,10 @@ function y(e, n, w, V, B, C) {
48
49
  onFocus: n[2] || (n[2] = (o) => e.onFocus()),
49
50
  "onUpdate:modelValue": e.valueChanged,
50
51
  onKeydown: [
51
- n[3] || (n[3] = d(u((o) => e.increment(), ["prevent"]), ["up"])),
52
- n[4] || (n[4] = d(u((o) => e.decrement(), ["prevent"]), ["down"]))
52
+ n[3] || (n[3] = s(u((o) => e.increment(), ["prevent"]), ["up"])),
53
+ n[4] || (n[4] = s(u((o) => e.decrement(), ["prevent"]), ["down"]))
53
54
  ]
54
- }), null, 16, ["aria-valuemax", "aria-valuemin", "aria-valuenow", "color", "disabled", "inputmode", "max", "min", "model-value", "placeholder", "size", "step", "onUpdate:modelValue"]),
55
+ }), null, 16, ["id", "aria-valuemax", "aria-valuemin", "aria-valuenow", "color", "disabled", "inputmode", "max", "min", "model-value", "placeholder", "size", "step", "onUpdate:modelValue"]),
55
56
  e.spinButtons ? (i(), a(r, {
56
57
  key: 1,
57
58
  "aria-label": e.incrementLabel,
@@ -62,7 +63,7 @@ function y(e, n, w, V, B, C) {
62
63
  class: "neon-number__increment",
63
64
  icon: "plus",
64
65
  onClick: n[5] || (n[5] = (o) => e.increment())
65
- }, null, 8, ["aria-label", "color", "disabled", "size"])) : s("", !0)
66
+ }, null, 8, ["aria-label", "color", "disabled", "size"])) : d("", !0)
66
67
  ]),
67
68
  _: 1
68
69
  }, 8, ["class"]);
@@ -1 +1 @@
1
- {"version":3,"file":"NeonNumber.vue.es.js","sources":["../../../../src/components/user-input/number/NeonNumber.vue"],"sourcesContent":["<template>\n <neon-field-group\n :class=\"[\n `neon-number--${size}`,\n `neon-number--${color}`,\n {\n 'neon-number--disabled': disabled,\n 'neon-number--editable': editable,\n 'neon-number--with-buttons': spinButtons,\n },\n ]\"\n class=\"neon-number\"\n indicator-style=\"external\"\n >\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"decrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (min !== undefined && min === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__decrement\"\n icon=\"minus\"\n @click=\"decrement()\"\n />\n <neon-input\n :aria-valuemax=\"max\"\n :aria-valuemin=\"min\"\n :aria-valuenow=\"modelValue\"\n :color=\"color\"\n :disabled=\"disabled || !editable\"\n :inputmode=\"inputmode\"\n :max=\"max\"\n :min=\"min\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :step=\"computedStep\"\n class=\"neon-number__input\"\n role=\"spinbutton\"\n type=\"text\"\n v-bind=\"sanitizedAttributes\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @update:modelValue=\"valueChanged\"\n @keydown.up.prevent=\"increment()\"\n @keydown.down.prevent=\"decrement()\"\n />\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"incrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (max !== undefined && max === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__increment\"\n icon=\"plus\"\n @click=\"increment()\"\n />\n </neon-field-group>\n</template>\n\n<script lang=\"ts\" src=\"./NeonNumber.ts\" />\n"],"names":["_createBlock","_component_neon_field_group","_normalizeClass","_ctx","_component_neon_button","_createVNode","_component_neon_input","_mergeProps"],"mappings":";;;;;cACEA,EA0DmBC,GAAA;AAAA,IAzDhB,OAAKC,EAAA,CAAA;AAAA,sBAA0BC,EAAA,IAAI;AAAA,sBAA0BA,EAAA,KAAK;AAAA;iCAA6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,EAAA;AAAA,QACP,gBAAa;AAAA,QACb,OAAM;AAAA,QACN,MAAK;AAAA,QACJ,gCAAOA,EAAA;;;;;;;"}
1
+ {"version":3,"file":"NeonNumber.vue.es.js","sources":["../../../../src/components/user-input/number/NeonNumber.vue"],"sourcesContent":["<template>\n <neon-field-group\n :class=\"[\n `neon-number--${size}`,\n `neon-number--${color}`,\n {\n 'neon-number--disabled': disabled,\n 'neon-number--editable': editable,\n 'neon-number--with-buttons': spinButtons,\n },\n ]\"\n class=\"neon-number\"\n indicator-style=\"external\"\n >\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"decrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (min !== undefined && min === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__decrement\"\n icon=\"minus\"\n @click=\"decrement()\"\n />\n <neon-input\n :id=\"id\"\n :aria-valuemax=\"max\"\n :aria-valuemin=\"min\"\n :aria-valuenow=\"modelValue\"\n :color=\"color\"\n :disabled=\"disabled || !editable\"\n :inputmode=\"inputmode\"\n :max=\"max\"\n :min=\"min\"\n :model-value=\"displayValue\"\n :placeholder=\"placeholder\"\n :size=\"size\"\n :step=\"computedStep\"\n class=\"neon-number__input\"\n role=\"spinbutton\"\n type=\"text\"\n v-bind=\"sanitizedAttributes\"\n @blur=\"onBlur()\"\n @focus=\"onFocus()\"\n @update:modelValue=\"valueChanged\"\n @keydown.up.prevent=\"increment()\"\n @keydown.down.prevent=\"decrement()\"\n />\n <neon-button\n v-if=\"spinButtons\"\n :aria-label=\"incrementLabel\"\n :color=\"color\"\n :disabled=\"disabled || (max !== undefined && max === modelValue)\"\n :size=\"size\"\n button-style=\"outline\"\n class=\"neon-number__increment\"\n icon=\"plus\"\n @click=\"increment()\"\n />\n </neon-field-group>\n</template>\n\n<script lang=\"ts\" src=\"./NeonNumber.ts\" />\n"],"names":["_createBlock","_component_neon_field_group","_normalizeClass","_ctx","_component_neon_button","_createVNode","_component_neon_input","_mergeProps"],"m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EAAA,oBADRH,EAUEI,GAAA;AAAA;QARC,cAAYD,EAAA;AAAA,QACZ,OAAOA,EAAA;AAAA,QACP,UAAUA,cAAaA,EAAA,QAAQ,UAAaA,EAAA,QAAQA,EAAA;AAAA,QACpD,MAAMA,EAAA;AAAA,QACP,gBAAa;AAAA,QACb,OAAM;AAAA,QACN,MAAK;AAAA,QACJ,gCAAOA,EAAA;;;;;;;"}
@@ -14,6 +14,8 @@ export declare enum NeonFunctionalColor {
14
14
  HighContrast = "high-contrast",
15
15
  /** Brand is the main brand color palette, this is useful for branded CTAs, text & controls. */
16
16
  Brand = "brand",
17
+ /** Accent is an alternative brand accent palette used when multiple brand colors are required */
18
+ Accent = "accent",
17
19
  /** Primary is the main application color palette. For most applications this will be used by default. */
18
20
  Primary = "primary",
19
21
  /** Info can be used to convey informational context, e.g. notes & alerts */
@@ -10,6 +10,13 @@ import { NeonInputMode } from '@/common/enums/NeonInputMode';
10
10
  * <p><strong>NeonNumber</strong> supports all the properties found on an HTML &lt;input&gt;.</p>
11
11
  */
12
12
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
13
+ /**
14
+ * The id the input
15
+ */
16
+ id: {
17
+ type: StringConstructor;
18
+ default: null;
19
+ };
13
20
  /**
14
21
  * The value of the number input. Either a valid number or null.
15
22
  */
@@ -146,6 +153,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
146
153
  onFocus: () => boolean;
147
154
  onBlur: () => boolean;
148
155
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
156
+ /**
157
+ * The id the input
158
+ */
159
+ id: {
160
+ type: StringConstructor;
161
+ default: null;
162
+ };
149
163
  /**
150
164
  * The value of the number input. Either a valid number or null.
151
165
  */
@@ -274,6 +288,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
274
288
  locale: string;
275
289
  size: NeonSize;
276
290
  color: NeonFunctionalColor;
291
+ id: string;
277
292
  placeholder: string;
278
293
  inputmode: NeonInputMode;
279
294
  modelValue: number;
@@ -316,7 +331,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
316
331
  };
317
332
  iconPosition: {
318
333
  type: () => import("../../../neon").NeonHorizontalPosition;
319
- default: import("../../../neon").NeonHorizontalPosition;
334
+ default: import("../../../neon").NeonHorizontalPosition; /**
335
+ * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.
336
+ */
320
337
  };
321
338
  buttonStyle: {
322
339
  type: () => import("../../../neon").NeonButtonStyle;
@@ -332,8 +349,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
332
349
  };
333
350
  disabled: {
334
351
  type: BooleanConstructor;
335
- default: boolean;
336
- };
352
+ default: boolean; /**
353
+ * The HTML inputmode of the component. Either 'numeric' or 'decimal'.
354
+ */
355
+ }; /**
356
+ * The HTML inputmode of the component. Either 'numeric' or 'decimal'.
357
+ */
337
358
  transparent: {
338
359
  type: BooleanConstructor;
339
360
  default: boolean;
@@ -415,7 +436,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
415
436
  };
416
437
  iconPosition: {
417
438
  type: () => import("../../../neon").NeonHorizontalPosition;
418
- default: import("../../../neon").NeonHorizontalPosition;
439
+ default: import("../../../neon").NeonHorizontalPosition; /**
440
+ * Show/hide spin buttons. NOTE: The user can still use up/down arrow keys when the input has focus.
441
+ */
419
442
  };
420
443
  buttonStyle: {
421
444
  type: () => import("../../../neon").NeonButtonStyle;
@@ -431,8 +454,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
431
454
  };
432
455
  disabled: {
433
456
  type: BooleanConstructor;
434
- default: boolean;
435
- };
457
+ default: boolean; /**
458
+ * The HTML inputmode of the component. Either 'numeric' or 'decimal'.
459
+ */
460
+ }; /**
461
+ * The HTML inputmode of the component. Either 'numeric' or 'decimal'.
462
+ */
436
463
  transparent: {
437
464
  type: BooleanConstructor;
438
465
  default: boolean;
@@ -531,25 +558,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
531
558
  color: {
532
559
  type: () => NeonFunctionalColor;
533
560
  default: null;
534
- }; /**
535
- * Placeholder text to display in the input
536
- */
561
+ };
537
562
  inverse: {
538
563
  type: BooleanConstructor;
539
- default: boolean; /**
540
- * Whether the component is disabled.
541
- */
542
- }; /**
543
- * Whether the component is disabled.
544
- */
564
+ default: boolean;
565
+ };
545
566
  disabled: {
546
567
  type: BooleanConstructor;
547
- default: boolean; /**
548
- * Enable/disable direct editing of the value.
549
- */
550
- }; /**
551
- * Enable/disable direct editing of the value.
552
- */
568
+ default: boolean;
569
+ };
553
570
  }>, {
554
571
  sanitizedAttributes: import("vue").ComputedRef<{
555
572
  [x: string]: unknown;
@@ -567,25 +584,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
567
584
  color: {
568
585
  type: () => NeonFunctionalColor;
569
586
  default: null;
570
- }; /**
571
- * Placeholder text to display in the input
572
- */
587
+ };
573
588
  inverse: {
574
589
  type: BooleanConstructor;
575
- default: boolean; /**
576
- * Whether the component is disabled.
577
- */
578
- }; /**
579
- * Whether the component is disabled.
580
- */
590
+ default: boolean;
591
+ };
581
592
  disabled: {
582
593
  type: BooleanConstructor;
583
- default: boolean; /**
584
- * Enable/disable direct editing of the value.
585
- */
586
- }; /**
587
- * Enable/disable direct editing of the value.
588
- */
594
+ default: boolean;
595
+ };
589
596
  }>> & Readonly<{}>, {
590
597
  disabled: boolean;
591
598
  color: NeonFunctionalColor;
@@ -604,10 +611,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
604
611
  outlineStyle: {
605
612
  type: () => import("../../../neon").NeonOutlineStyle;
606
613
  default: import("../../../neon").NeonOutlineStyle; /**
607
- * The value of the number input. Either a valid number or null.
614
+ * The id the input
608
615
  */
609
616
  }; /**
610
- * The value of the number input. Either a valid number or null.
617
+ * The id the input
611
618
  */
612
619
  externalIndicator: {
613
620
  type: BooleanConstructor;
@@ -635,10 +642,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
635
642
  outlineStyle: {
636
643
  type: () => import("../../../neon").NeonOutlineStyle;
637
644
  default: import("../../../neon").NeonOutlineStyle; /**
638
- * The value of the number input. Either a valid number or null.
645
+ * The id the input
639
646
  */
640
647
  }; /**
641
- * The value of the number input. Either a valid number or null.
648
+ * The id the input
642
649
  */
643
650
  externalIndicator: {
644
651
  type: BooleanConstructor;
@@ -664,25 +671,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
664
671
  color: {
665
672
  type: () => NeonFunctionalColor;
666
673
  default: null;
667
- }; /**
668
- * Placeholder text to display in the input
669
- */
674
+ };
670
675
  inverse: {
671
676
  type: BooleanConstructor;
672
- default: boolean; /**
673
- * Whether the component is disabled.
674
- */
675
- }; /**
676
- * Whether the component is disabled.
677
- */
677
+ default: boolean;
678
+ };
678
679
  disabled: {
679
680
  type: BooleanConstructor;
680
- default: boolean; /**
681
- * Enable/disable direct editing of the value.
682
- */
683
- }; /**
684
- * Enable/disable direct editing of the value.
685
- */
681
+ default: boolean;
682
+ };
686
683
  }>, {
687
684
  sanitizedAttributes: import("vue").ComputedRef<{
688
685
  [x: string]: unknown;
@@ -700,25 +697,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
700
697
  color: {
701
698
  type: () => NeonFunctionalColor;
702
699
  default: null;
703
- }; /**
704
- * Placeholder text to display in the input
705
- */
700
+ };
706
701
  inverse: {
707
702
  type: BooleanConstructor;
708
- default: boolean; /**
709
- * Whether the component is disabled.
710
- */
711
- }; /**
712
- * Whether the component is disabled.
713
- */
703
+ default: boolean;
704
+ };
714
705
  disabled: {
715
706
  type: BooleanConstructor;
716
- default: boolean; /**
717
- * Enable/disable direct editing of the value.
718
- */
719
- }; /**
720
- * Enable/disable direct editing of the value.
721
- */
707
+ default: boolean;
708
+ };
722
709
  }>> & Readonly<{}>, {
723
710
  disabled: boolean;
724
711
  color: NeonFunctionalColor;
@@ -789,10 +776,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
789
776
  };
790
777
  autocomplete: {
791
778
  type: StringConstructor;
779
+ /**
780
+ * Whether the component is disabled.
781
+ */
792
782
  default: string;
793
783
  };
794
784
  state: {
795
- type: () => import("../../../neon").NeonState;
785
+ type: () => import("../../../neon").NeonState; /**
786
+ * Enable/disable direct editing of the value.
787
+ */
796
788
  default: import("../../../neon").NeonState;
797
789
  };
798
790
  rows: {
@@ -802,7 +794,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
802
794
  icon: {
803
795
  type: StringConstructor;
804
796
  default: null;
805
- };
797
+ }; /**
798
+ * The rounding precision for display formatting.
799
+ */
806
800
  iconReadonly: {
807
801
  type: BooleanConstructor;
808
802
  default: boolean;
@@ -888,10 +882,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
888
882
  };
889
883
  autocomplete: {
890
884
  type: StringConstructor;
885
+ /**
886
+ * Whether the component is disabled.
887
+ */
891
888
  default: string;
892
889
  };
893
890
  state: {
894
- type: () => import("../../../neon").NeonState;
891
+ type: () => import("../../../neon").NeonState; /**
892
+ * Enable/disable direct editing of the value.
893
+ */
895
894
  default: import("../../../neon").NeonState;
896
895
  };
897
896
  rows: {
@@ -901,7 +900,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
901
900
  icon: {
902
901
  type: StringConstructor;
903
902
  default: null;
904
- };
903
+ }; /**
904
+ * The rounding precision for display formatting.
905
+ */
905
906
  iconReadonly: {
906
907
  type: BooleanConstructor;
907
908
  default: boolean;
@@ -977,25 +978,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
977
978
  color: {
978
979
  type: () => NeonFunctionalColor;
979
980
  default: null;
980
- }; /**
981
- * Placeholder text to display in the input
982
- */
981
+ };
983
982
  inverse: {
984
983
  type: BooleanConstructor;
985
- default: boolean; /**
986
- * Whether the component is disabled.
987
- */
988
- }; /**
989
- * Whether the component is disabled.
990
- */
984
+ default: boolean;
985
+ };
991
986
  disabled: {
992
987
  type: BooleanConstructor;
993
- default: boolean; /**
994
- * Enable/disable direct editing of the value.
995
- */
996
- }; /**
997
- * Enable/disable direct editing of the value.
998
- */
988
+ default: boolean;
989
+ };
999
990
  }>, {
1000
991
  sanitizedAttributes: import("vue").ComputedRef<{
1001
992
  [x: string]: unknown;
@@ -1013,25 +1004,15 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1013
1004
  color: {
1014
1005
  type: () => NeonFunctionalColor;
1015
1006
  default: null;
1016
- }; /**
1017
- * Placeholder text to display in the input
1018
- */
1007
+ };
1019
1008
  inverse: {
1020
1009
  type: BooleanConstructor;
1021
- default: boolean; /**
1022
- * Whether the component is disabled.
1023
- */
1024
- }; /**
1025
- * Whether the component is disabled.
1026
- */
1010
+ default: boolean;
1011
+ };
1027
1012
  disabled: {
1028
1013
  type: BooleanConstructor;
1029
- default: boolean; /**
1030
- * Enable/disable direct editing of the value.
1031
- */
1032
- }; /**
1033
- * Enable/disable direct editing of the value.
1034
- */
1014
+ default: boolean;
1015
+ };
1035
1016
  }>> & Readonly<{}>, {
1036
1017
  disabled: boolean;
1037
1018
  color: NeonFunctionalColor;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aotearoan/neon",
3
3
  "description": "Neon is a lightweight design library of Vue 3 components with minimal dependencies.",
4
- "version": "23.2.5",
4
+ "version": "23.3.0",
5
5
  "main": "./dist/neon.cjs.js",
6
6
  "module": "./dist/neon.es.js",
7
7
  "types": "./dist/src/neon.d.ts",
@@ -59,6 +59,17 @@
59
59
  --neon-color-brand-d4: rgb(var(--neon-rgb-brand-d4));
60
60
  --neon-color-brand-d5: rgb(var(--neon-rgb-brand-d5));
61
61
 
62
+ --neon-color-accent-l5: rgb(var(--neon-rgb-accent-l5));
63
+ --neon-color-accent-l4: rgb(var(--neon-rgb-accent-l4));
64
+ --neon-color-accent-l3: rgb(var(--neon-rgb-accent-l3));
65
+ --neon-color-accent-l2: rgb(var(--neon-rgb-accent-l2));
66
+ --neon-color-accent-l1: rgb(var(--neon-rgb-accent-l1));
67
+ --neon-color-accent-d1: rgb(var(--neon-rgb-accent-d1));
68
+ --neon-color-accent-d2: rgb(var(--neon-rgb-accent-d2));
69
+ --neon-color-accent-d3: rgb(var(--neon-rgb-accent-d3));
70
+ --neon-color-accent-d4: rgb(var(--neon-rgb-accent-d4));
71
+ --neon-color-accent-d5: rgb(var(--neon-rgb-accent-d5));
72
+
62
73
  --neon-color-primary-l5: rgb(var(--neon-rgb-primary-l5));
63
74
  --neon-color-primary-l4: rgb(var(--neon-rgb-primary-l4));
64
75
  --neon-color-primary-l3: rgb(var(--neon-rgb-primary-l3));
@@ -105,6 +105,7 @@
105
105
 
106
106
  @mixin button-small {
107
107
  height: var(--neon-size-s);
108
+ min-height: var(--neon-size-s);
108
109
  font-size: var(--neon-font-size-s);
109
110
  line-height: var(--neon-line-height-one);
110
111
  padding: 0 calc(0.75 * (var(--neon-size-s) - var(--neon-font-size-s)));
@@ -131,6 +132,7 @@
131
132
 
132
133
  @mixin button-medium {
133
134
  height: var(--neon-size-m);
135
+ min-height: var(--neon-size-m);
134
136
  font-size: var(--neon-font-size-m);
135
137
  line-height: var(--neon-line-height-one);
136
138
  padding: 0 calc(0.75 * (var(--neon-size-m) - var(--neon-font-size-m)));
@@ -157,6 +159,7 @@
157
159
 
158
160
  @mixin button-large {
159
161
  height: var(--neon-size-l);
162
+ min-height: var(--neon-size-l);
160
163
  font-size: var(--neon-font-size-m);
161
164
  line-height: var(--neon-line-height-one);
162
165
  padding: 0 calc(0.75 * (var(--neon-size-l) - var(--neon-font-size-m)));
@@ -191,7 +194,7 @@
191
194
  margin-right: 0;
192
195
  cursor: pointer;
193
196
  text-decoration: none;
194
- font-family: var(--neon-font-family-body);
197
+ font-family: var(--neon-font-family-button);
195
198
 
196
199
  &--s {
197
200
  @include button-small;
@@ -21,6 +21,8 @@
21
21
  width: 100%;
22
22
 
23
23
  &__button .neon-button__label {
24
+ --neon-text-transform-button: none;
25
+ --neon-font-family-button: var(--neon-font-family-body);
24
26
  font-variant: tabular-nums;
25
27
  }
26
28
  }
@@ -4,7 +4,7 @@
4
4
  @mixin neon-menu-size($size) {
5
5
  .neon-menu__item {
6
6
  height: 100%;
7
- font-size: var(--neon-font-size-#{$size});
7
+ font-size: var(--neon-font-size-menu);
8
8
  align-items: center;
9
9
  display: flex;
10
10
 
@@ -22,13 +22,14 @@
22
22
  position: relative;
23
23
  gap: var(--neon-space-12);
24
24
  font-family: var(--neon-font-family-menu);
25
+ text-transform: var(--neon-text-transform-menu);
25
26
  font-weight: var(--neon-font-weight-menu);
26
- @include svg.color-with-svg(var(--neon-color-text-tertiary));
27
+ @include svg.color-with-svg(var(--neon-color-menu));
27
28
 
28
29
  &,
29
30
  .neon-svg--stroke,
30
31
  .neon-svg--fill {
31
- transition: color ease-in-out var(--neon-animation-speed-slow);
32
+ transition: color ease-in-out var(--neon-animation-speed-fastest);
32
33
  }
33
34
 
34
35
  &:before {
@@ -39,7 +40,7 @@
39
40
  width: 100%;
40
41
  opacity: 0;
41
42
  height: var(--neon-height-menu-indicator);
42
- transition: opacity ease-in-out var(--neon-animation-speed-slow);
43
+ transition: opacity ease-in-out var(--neon-animation-speed-fastest);
43
44
  }
44
45
  }
45
46
  }
@@ -48,7 +49,7 @@
48
49
  .neon-link {
49
50
  &:hover {
50
51
  .neon-menu__link-container {
51
- @include svg.color-with-svg(var(--neon-color-text-primary));
52
+ @include svg.color-with-svg(var(--neon-color-menu-active));
52
53
 
53
54
  &:before {
54
55
  opacity: 1;
@@ -59,13 +60,13 @@
59
60
 
60
61
  &:focus {
61
62
  .neon-menu__link-container {
62
- @include svg.color-with-svg(var(--neon-color-text-primary));
63
+ @include svg.color-with-svg(var(--neon-color-menu-active));
63
64
  }
64
65
  }
65
66
 
66
67
  &.router-link-active {
67
68
  .neon-menu__link-container {
68
- @include svg.color-with-svg(var(--neon-color-text-primary));
69
+ @include svg.color-with-svg(var(--neon-color-menu-active));
69
70
 
70
71
  &:before {
71
72
  opacity: 1;
@@ -182,7 +183,8 @@
182
183
  }
183
184
 
184
185
  &__responsive-menu {
185
- font-family: var(--neon-font-family-heading);
186
+ font-family: var(--neon-font-family-menu);
187
+ text-transform: var(--neon-text-transform-menu);
186
188
 
187
189
  &.neon-menu__responsive-menu:not(:first-child) {
188
190
  margin-left: calc(5 * var(--neon-base-space));
@@ -213,7 +215,8 @@
213
215
  &__label {
214
216
  display: flex;
215
217
  align-items: center;
216
- font-family: var(--neon-font-family-heading);
218
+ font-family: var(--neon-font-family-menu);
219
+ text-transform: var(--neon-text-transform-menu);
217
220
  }
218
221
  }
219
222
 
@@ -225,21 +228,25 @@
225
228
  }
226
229
 
227
230
  .neon-dropdown .neon-dropdown__button {
228
- font-family: var(--neon-font-family-heading);
231
+ font-family: var(--neon-font-family-menu);
232
+ text-transform: var(--neon-text-transform-menu);
229
233
  font-weight: var(--neon-font-weight-normal);
230
234
  letter-spacing: var(--neon-letter-spacing-m);
231
235
  }
232
236
  }
233
237
 
234
238
  &.neon-menu--s {
239
+ --neon-font-size-menu: var(--neon-font-size-menu-s);
235
240
  @include neon-menu-size('s');
236
241
  }
237
242
 
238
243
  &.neon-menu--m {
244
+ --neon-font-size-menu: var(--neon-font-size-menu-m);
239
245
  @include neon-menu-size('m');
240
246
  }
241
247
 
242
248
  &.neon-menu--l {
249
+ --neon-font-size-menu: var(--neon-font-size-menu-l);
243
250
  @include neon-menu-size('l');
244
251
  }
245
252
  }
@@ -26,12 +26,12 @@
26
26
  font-size: var(--neon-font-size-mobile-menu);
27
27
  line-height: var(--neon-line-height-mobile-menu);
28
28
  font-weight: var(--neon-font-weight-mobile-menu);
29
- @include svg.color-with-svg(var(--neon-color-text-tertiary));
29
+ @include svg.color-with-svg(var(--neon-color-mobile-menu));
30
30
 
31
31
  &,
32
32
  .neon-svg--stroke,
33
33
  .neon-svg--fill {
34
- transition: color ease-in-out var(--neon-animation-speed-slow);
34
+ transition: color ease-in-out var(--neon-animation-speed-fastest);
35
35
  }
36
36
 
37
37
  &:before {
@@ -42,7 +42,7 @@
42
42
  width: 100%;
43
43
  opacity: 0;
44
44
  height: var(--neon-height-mobile-menu-indicator);
45
- transition: opacity ease-in-out var(--neon-animation-speed-slow);
45
+ transition: color ease-in-out var(--neon-animation-speed-fastest);
46
46
  }
47
47
  }
48
48
  }
@@ -51,7 +51,7 @@
51
51
  .neon-link {
52
52
  &:hover {
53
53
  .neon-mobile-menu__link-container {
54
- @include svg.color-with-svg(var(--neon-color-text-primary));
54
+ @include svg.color-with-svg(var(--neon-color-mobile-menu-active));
55
55
 
56
56
  &:before {
57
57
  opacity: 1;
@@ -61,13 +61,13 @@
61
61
 
62
62
  &:focus {
63
63
  .neon-mobile-menu__link-container {
64
- @include svg.color-with-svg(var(--neon-color-text-primary));
64
+ @include svg.color-with-svg(var(--neon-color-mobile-menu-active));
65
65
  }
66
66
  }
67
67
 
68
68
  &.router-link-active {
69
69
  .neon-mobile-menu__link-container {
70
- @include svg.color-with-svg(var(--neon-color-text-primary));
70
+ @include svg.color-with-svg(var(--neon-color-mobile-menu-active));
71
71
 
72
72
  &:before {
73
73
  opacity: 1;
@@ -11,6 +11,8 @@
11
11
  }
12
12
 
13
13
  .neon-dropdown__button {
14
+ --neon-text-transform-button: none;
15
+ --neon-font-family-button: var(--neon-font-family-body);
14
16
  padding-left: var(--neon-space-8);
15
17
  font-weight: var(--neon-font-weight-input);
16
18
 
@@ -121,13 +121,6 @@
121
121
  }
122
122
  }
123
123
 
124
- .neon-stepper__step--active, {
125
- .neon-stepper__step-title {
126
- font-weight: var(--neon-font-weight-semi-bold);
127
- color: var(--neon-color-#{$color});
128
- }
129
- }
130
-
131
124
  .neon-stepper__step--display-stepper {
132
125
  &:not(:first-child) {
133
126
  &:before {
@@ -167,6 +167,10 @@
167
167
  color: var(--neon-color-brand);
168
168
  }
169
169
 
170
+ .neon-color-accent {
171
+ color: var(--neon-color-accent);
172
+ }
173
+
170
174
  .neon-color-primary {
171
175
  color: var(--neon-color-primary);
172
176
  }
@@ -7,6 +7,10 @@
7
7
  font-weight: var(--neon-font-weight-body);
8
8
  font-size: 16px;
9
9
  line-height: var(--neon-line-height-ratio);
10
+
11
+ @include responsive.responsive(mobile-large) {
12
+ font-size: 17px; // don't use rems here - body font must be defined in pixels
13
+ }
10
14
  }
11
15
 
12
16
  p {
@@ -3,6 +3,7 @@ $neon-functional-colors: (
3
3
  low-contrast,
4
4
  high-contrast,
5
5
  brand,
6
+ accent,
6
7
  primary,
7
8
  info,
8
9
  success,
@@ -15,6 +16,7 @@ $neon-button-colors: (
15
16
  low-contrast,
16
17
  high-contrast,
17
18
  brand,
19
+ accent,
18
20
  primary,
19
21
  info,
20
22
  success,
@@ -55,6 +55,16 @@
55
55
  --neon-rgb-brand-d3: 87, 40, 119;
56
56
  --neon-rgb-brand-d4: 56, 30, 74;
57
57
  --neon-rgb-brand-d5: 33, 25, 37;
58
+ --neon-rgb-accent-l5: 255, 238, 250;
59
+ --neon-rgb-accent-l4: 255, 204, 239;
60
+ --neon-rgb-accent-l3: 255, 171, 227;
61
+ --neon-rgb-accent-l2: 251, 140, 212;
62
+ --neon-rgb-accent-l1: 239, 108, 196;
63
+ --neon-rgb-accent-d1: 171, 41, 134;
64
+ --neon-rgb-accent-d2: 145, 40, 114;
65
+ --neon-rgb-accent-d3: 110, 31, 86;
66
+ --neon-rgb-accent-d4: 70, 25, 55;
67
+ --neon-rgb-accent-d5: 38, 23, 32;
58
68
  --neon-rgb-primary-l5: 245, 241, 255;
59
69
  --neon-rgb-primary-l4: 222, 214, 255;
60
70
  --neon-rgb-primary-l3: 197, 187, 255;
@@ -15,6 +15,7 @@ $neon-components: null !default;
15
15
  @include color-mixins.generate-color-classes('low-contrast');
16
16
  @include color-mixins.generate-color-classes('high-contrast');
17
17
  @include color-mixins.generate-color-classes('brand');
18
+ @include color-mixins.generate-color-classes('accent');
18
19
  @include color-mixins.generate-color-classes('primary');
19
20
  @include color-mixins.generate-color-classes('info');
20
21
  @include color-mixins.generate-color-classes('success');
@@ -2,12 +2,6 @@
2
2
  @import './palette';
3
3
  @import './color-variables';
4
4
 
5
- @include responsive.responsive(mobile-large) {
6
- body {
7
- font-size: 17px; // don't use rems here - body font must be defined in pixels
8
- }
9
- }
10
-
11
5
  .neon {
12
6
  /*********************
13
7
  * Global Variables
@@ -290,7 +284,11 @@
290
284
  /* menu */
291
285
  --neon-font-family-menu: var(--neon-font-family-body);
292
286
  --neon-font-weight-menu: var(--neon-font-weight-bold);
287
+ --neon-text-transform-menu: none;
293
288
  --neon-height-menu-indicator: 4rem;
289
+ --neon-font-size-menu-s: var(--neon-font-size-s);
290
+ --neon-font-size-menu-m: var(--neon-font-size-m);
291
+ --neon-font-size-menu-l: var(--neon-font-size-l);
294
292
 
295
293
  /* mobile menu */
296
294
  --neon-font-family-mobile-menu: var(--neon-font-family-body);
@@ -309,6 +307,7 @@
309
307
  --neon-border-radius-button-xl: var(--neon-border-radius);
310
308
  --neon-border-width-outline-button: 1rem;
311
309
  --neon-text-transform-button: none;
310
+ --neon-font-family-button: var(--neon-font-family-body);
312
311
  --neon-font-weight-button: var(--neon-font-weight-medium);
313
312
  --neon-letter-spacing-button: var(--neon-letter-spacing-m);
314
313
 
@@ -479,6 +478,7 @@
479
478
  --neon-rgb-neutral: var(--neon-rgb-neutral-l1);
480
479
  --neon-rgb-high-contrast: var(--neon-rgb-high-contrast-l1);
481
480
  --neon-rgb-brand: var(--neon-rgb-brand-l1);
481
+ --neon-rgb-accent: var(--neon-rgb-accent-l1);
482
482
  --neon-rgb-primary: var(--neon-rgb-primary-l1);
483
483
  --neon-rgb-info: var(--neon-rgb-info-l1);
484
484
  --neon-rgb-success: var(--neon-rgb-success-l1);
@@ -489,6 +489,7 @@
489
489
  --neon-color-neutral: var(--neon-color-neutral-l1);
490
490
  --neon-color-high-contrast: var(--neon-color-high-contrast-l1);
491
491
  --neon-color-brand: var(--neon-color-brand-l1);
492
+ --neon-color-accent: var(--neon-color-accent-l1);
492
493
  --neon-color-primary: var(--neon-color-primary-l1);
493
494
  --neon-color-info: var(--neon-color-info-l1);
494
495
  --neon-color-success: var(--neon-color-success-l1);
@@ -500,6 +501,7 @@
500
501
  --neon-background-color-neutral: var(--neon-color-neutral-d1);
501
502
  --neon-background-color-high-contrast: var(--neon-color-high-contrast-d1);
502
503
  --neon-background-color-brand: var(--neon-color-brand-d1);
504
+ --neon-background-color-accent: var(--neon-color-accent-d1);
503
505
  --neon-background-color-primary: var(--neon-color-primary-d1);
504
506
  --neon-background-color-info: var(--neon-color-info-d1);
505
507
  --neon-background-color-success: var(--neon-color-success-d1);
@@ -551,6 +553,10 @@
551
553
  --neon-background-rgb-solid-button-dark-brand: var(--neon-rgb-brand-l1);
552
554
  --neon-background-solid-button-dark-brand: var(--neon-color-brand-l1);
553
555
 
556
+ --neon-background-solid-button-light-accent: var(--neon-color-accent-l2);
557
+ --neon-background-rgb-solid-button-dark-accent: var(--neon-rgb-accent-l1);
558
+ --neon-background-solid-button-dark-accent: var(--neon-color-accent-l1);
559
+
554
560
  --neon-background-solid-button-light-primary: var(--neon-color-primary-l2);
555
561
  --neon-background-rgb-solid-button-dark-primary: var(--neon-rgb-primary-l1);
556
562
  --neon-background-solid-button-dark-primary: var(--neon-color-primary-l1);
@@ -587,6 +593,9 @@
587
593
  --neon-background-outline-button-hover-brand: var(--neon-color-brand-l2);
588
594
  --neon-background-outline-button-active-brand: var(--neon-color-brand-l1);
589
595
 
596
+ --neon-background-outline-button-hover-accent: var(--neon-color-accent-l2);
597
+ --neon-background-outline-button-active-accent: var(--neon-color-accent-l1);
598
+
590
599
  --neon-background-outline-button-hover-primary: var(--neon-color-primary-l2);
591
600
  --neon-background-outline-button-active-primary: var(--neon-color-primary-l1);
592
601
 
@@ -620,9 +629,15 @@
620
629
  /* action menu */
621
630
  --neon-color-action-menu-hover: var(--neon-color-neutral-d3);
622
631
 
632
+ /* menu */
633
+ --neon-color-menu: var(--neon-color-text-tertiary);
634
+ --neon-color-menu-active: var(--neon-color-text-primary);
635
+
623
636
  /* mobile menu */
624
637
  --neon-border-top-mobile-menu: var(--neon-height-mobile-menu-indicator) var(--neon-border-style) var(--neon-border-color);
625
638
  --neon-background-color-mobile-menu: var(--neon-background-color-card);
639
+ --neon-color-mobile-menu: var(--neon-color-text-tertiary);
640
+ --neon-color-mobile-menu-active: var(--neon-color-text-primary);
626
641
 
627
642
  /* selection */
628
643
  --neon-background-rgb-selection: var(--neon-rgb-info-l1);
@@ -700,6 +715,7 @@
700
715
  --neon-color-tab-selected-neutral: var(--neon-color-neutral-l1);
701
716
  --neon-color-tab-selected-high-contrast: var(--neon-color-high-contrast-l1);
702
717
  --neon-color-tab-selected-brand: var(--neon-color-brand-l1);
718
+ --neon-color-tab-selected-accent: var(--neon-color-accent-l1);
703
719
  --neon-color-tab-selected-primary: var(--neon-color-primary-l1);
704
720
  --neon-color-tab-selected-info: var(--neon-color-info-l1);
705
721
  --neon-color-tab-selected-success: var(--neon-color-success-l1);
@@ -709,6 +725,7 @@
709
725
  --neon-color-tab-hover-neutral: var(--neon-color-neutral-l2);
710
726
  --neon-color-tab-hover-high-contrast: var(--neon-color-high-contrast-l2);
711
727
  --neon-color-tab-hover-brand: var(--neon-color-brand-l2);
728
+ --neon-color-tab-hover-accent: var(--neon-color-accent-l2);
712
729
  --neon-color-tab-hover-primary: var(--neon-color-primary-l2);
713
730
  --neon-color-tab-hover-info: var(--neon-color-info-l2);
714
731
  --neon-color-tab-hover-success: var(--neon-color-success-l2);
@@ -801,6 +818,7 @@
801
818
  --neon-rgb-neutral: var(--neon-rgb-neutral-d1);
802
819
  --neon-rgb-high-contrast: var(--neon-rgb-high-contrast-d1);
803
820
  --neon-rgb-brand: var(--neon-rgb-brand-d1);
821
+ --neon-rgb-accent: var(--neon-rgb-accent-d1);
804
822
  --neon-rgb-primary: var(--neon-rgb-primary-d1);
805
823
  --neon-rgb-info: var(--neon-rgb-info-d1);
806
824
  --neon-rgb-success: var(--neon-rgb-success-d1);
@@ -811,6 +829,7 @@
811
829
  --neon-color-neutral: var(--neon-color-neutral-d1);
812
830
  --neon-color-high-contrast: var(--neon-color-high-contrast-d1);
813
831
  --neon-color-brand: var(--neon-color-brand-d1);
832
+ --neon-color-accent: var(--neon-color-accent-d1);
814
833
  --neon-color-primary: var(--neon-color-primary-d1);
815
834
  --neon-color-info: var(--neon-color-info-d1);
816
835
  --neon-color-success: var(--neon-color-success-d1);
@@ -822,6 +841,7 @@
822
841
  --neon-background-color-neutral: var(--neon-color-neutral-l1);
823
842
  --neon-background-color-high-contrast: var(--neon-color-high-contrast-l1);
824
843
  --neon-background-color-brand: var(--neon-color-brand-l1);
844
+ --neon-background-color-accent: var(--neon-color-accent-l1);
825
845
  --neon-background-color-primary: var(--neon-color-primary-l1);
826
846
  --neon-background-color-info: var(--neon-color-info-l1);
827
847
  --neon-background-color-success: var(--neon-color-success-l1);
@@ -873,6 +893,10 @@
873
893
  --neon-background-rgb-solid-button-dark-brand: var(--neon-rgb-brand-d2);
874
894
  --neon-background-solid-button-dark-brand: var(--neon-color-brand-d2);
875
895
 
896
+ --neon-background-solid-button-light-accent: var(--neon-color-accent-d1);
897
+ --neon-background-rgb-solid-button-dark-accent: var(--neon-rgb-accent-d2);
898
+ --neon-background-solid-button-dark-accent: var(--neon-color-accent-d2);
899
+
876
900
  --neon-background-solid-button-light-primary: var(--neon-color-primary-d1);
877
901
  --neon-background-rgb-solid-button-dark-primary: var(--neon-rgb-primary-d2);
878
902
  --neon-background-solid-button-dark-primary: var(--neon-color-primary-d2);
@@ -909,6 +933,9 @@
909
933
  --neon-background-outline-button-hover-brand: var(--neon-color-brand-d1);
910
934
  --neon-background-outline-button-active-brand: var(--neon-color-brand-d2);
911
935
 
936
+ --neon-background-outline-button-hover-accent: var(--neon-color-accent-d1);
937
+ --neon-background-outline-button-active-accent: var(--neon-color-accent-d2);
938
+
912
939
  --neon-background-outline-button-hover-primary: var(--neon-color-primary-d1);
913
940
  --neon-background-outline-button-active-primary: var(--neon-color-primary-d2);
914
941
 
@@ -942,9 +969,15 @@
942
969
  /* action menu */
943
970
  --neon-color-action-menu-hover: var(--neon-color-neutral-l4);
944
971
 
972
+ /* menu */
973
+ --neon-color-menu: var(--neon-color-text-tertiary);
974
+ --neon-color-menu-active: var(--neon-color-text-primary);
975
+
945
976
  /* mobile menu */
946
977
  --neon-border-top-mobile-menu: var(--neon-height-mobile-menu-indicator) var(--neon-border-style) var(--neon-border-color);
947
978
  --neon-background-color-mobile-menu: var(--neon-background-color-card);
979
+ --neon-color-mobile-menu: var(--neon-color-text-tertiary);
980
+ --neon-color-mobile-menu-active: var(--neon-color-text-primary);
948
981
 
949
982
  /* selection */
950
983
  --neon-background-rgb-selection: var(--neon-rgb-info-d1);
@@ -1022,6 +1055,7 @@
1022
1055
  --neon-color-tab-selected-neutral: var(--neon-color-neutral-d2);
1023
1056
  --neon-color-tab-selected-high-contrast: var(--neon-color-high-contrast-d2);
1024
1057
  --neon-color-tab-selected-brand: var(--neon-color-brand-d2);
1058
+ --neon-color-tab-selected-accent: var(--neon-color-accent-d2);
1025
1059
  --neon-color-tab-selected-primary: var(--neon-color-primary-d2);
1026
1060
  --neon-color-tab-selected-info: var(--neon-color-info-d2);
1027
1061
  --neon-color-tab-selected-success: var(--neon-color-success-d2);
@@ -1031,6 +1065,7 @@
1031
1065
  --neon-color-tab-hover-neutral: var(--neon-color-neutral-d1);
1032
1066
  --neon-color-tab-hover-high-contrast: var(--neon-color-high-contrast-d1);
1033
1067
  --neon-color-tab-hover-brand: var(--neon-color-brand-d1);
1068
+ --neon-color-tab-hover-accent: var(--neon-color-accent-d1);
1034
1069
  --neon-color-tab-hover-primary: var(--neon-color-primary-d1);
1035
1070
  --neon-color-tab-hover-info: var(--neon-color-info-d1);
1036
1071
  --neon-color-tab-hover-success: var(--neon-color-success-d1);