@trendyol/baklava 3.5.0-beta.7 → 3.5.0-beta.9

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 (50) hide show
  1. package/dist/baklava-svelte.d.ts +2 -0
  2. package/dist/baklava.js +1 -1
  3. package/dist/chunk-3D7WG3ON.js +5 -0
  4. package/dist/chunk-3D7WG3ON.js.map +7 -0
  5. package/dist/{chunk-NODTAMYY.js → chunk-DAMBW5GX.js} +2 -2
  6. package/dist/{chunk-UOF574WZ.js → chunk-FZJKSA6H.js} +2 -2
  7. package/dist/chunk-LYHOM7F5.js +37 -0
  8. package/dist/chunk-LYHOM7F5.js.map +7 -0
  9. package/dist/{chunk-2ARF4VOQ.js → chunk-PQEZBW3G.js} +7 -6
  10. package/dist/chunk-PQEZBW3G.js.map +7 -0
  11. package/dist/{chunk-DE3A37FL.js → chunk-TBB5HNL6.js} +2 -2
  12. package/dist/chunk-ZLE5MDX7.js +2 -0
  13. package/dist/chunk-ZLE5MDX7.js.map +7 -0
  14. package/dist/{chunk-4UO3W4WP.js → chunk-ZQ4MQ3U6.js} +2 -2
  15. package/dist/chunk-ZQ4MQ3U6.js.map +7 -0
  16. package/dist/components/button/bl-button.js +1 -1
  17. package/dist/components/calendar/bl-calendar.js +1 -1
  18. package/dist/components/datepicker/bl-datepicker.d.ts +4 -0
  19. package/dist/components/datepicker/bl-datepicker.d.ts.map +1 -1
  20. package/dist/components/datepicker/bl-datepicker.js +1 -1
  21. package/dist/components/dialog/bl-dialog.js +1 -1
  22. package/dist/components/drawer/bl-drawer.js +1 -1
  23. package/dist/components/dropdown/bl-dropdown.js +1 -1
  24. package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
  25. package/dist/components/input/bl-input.js +1 -1
  26. package/dist/components/pagination/bl-pagination.js +1 -1
  27. package/dist/components/popover/bl-popover.d.ts.map +1 -1
  28. package/dist/components/popover/bl-popover.js +1 -1
  29. package/dist/components/select/bl-select.js +1 -1
  30. package/dist/components/split-button/bl-split-button.js +1 -1
  31. package/dist/components/stepper/bl-stepper-item.d.ts.map +1 -1
  32. package/dist/components/stepper/bl-stepper-item.js +1 -1
  33. package/dist/components/stepper/bl-stepper.js +1 -1
  34. package/dist/components/tag/bl-tag.js +1 -1
  35. package/dist/components/tooltip/bl-tooltip.js +1 -1
  36. package/dist/components/tooltip/bl-tooltip.test.d.ts +6 -1
  37. package/dist/components/tooltip/bl-tooltip.test.d.ts.map +1 -1
  38. package/dist/custom-elements.json +24 -0
  39. package/package.json +9 -7
  40. package/dist/chunk-2ARF4VOQ.js.map +0 -7
  41. package/dist/chunk-3CGZ2A5B.js +0 -37
  42. package/dist/chunk-3CGZ2A5B.js.map +0 -7
  43. package/dist/chunk-4UO3W4WP.js.map +0 -7
  44. package/dist/chunk-EZSEQHRH.js +0 -2
  45. package/dist/chunk-EZSEQHRH.js.map +0 -7
  46. package/dist/chunk-UOGCEUXK.js +0 -5
  47. package/dist/chunk-UOGCEUXK.js.map +0 -7
  48. /package/dist/{chunk-NODTAMYY.js.map → chunk-DAMBW5GX.js.map} +0 -0
  49. /package/dist/{chunk-UOF574WZ.js.map → chunk-FZJKSA6H.js.map} +0 -0
  50. /package/dist/{chunk-DE3A37FL.js.map → chunk-TBB5HNL6.js.map} +0 -0
@@ -3906,6 +3906,19 @@
3906
3906
  "text": "string"
3907
3907
  }
3908
3908
  },
3909
+ {
3910
+ "kind": "field",
3911
+ "name": "error",
3912
+ "type": {
3913
+ "text": "string"
3914
+ },
3915
+ "description": "Sets input error state",
3916
+ "attribute": "error",
3917
+ "reflects": true,
3918
+ "parsedType": {
3919
+ "text": "string"
3920
+ }
3921
+ },
3909
3922
  {
3910
3923
  "kind": "field",
3911
3924
  "name": "dayRenderer",
@@ -4147,6 +4160,17 @@
4147
4160
  },
4148
4161
  "description": "Defines help text to datepicker input for users",
4149
4162
  "fieldName": "helpText"
4163
+ },
4164
+ {
4165
+ "name": "error",
4166
+ "type": {
4167
+ "text": "string"
4168
+ },
4169
+ "description": "Sets input error state",
4170
+ "fieldName": "error",
4171
+ "parsedType": {
4172
+ "text": "string"
4173
+ }
4150
4174
  }
4151
4175
  ],
4152
4176
  "superclass": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trendyol/baklava",
3
3
  "type": "module",
4
- "version": "3.5.0-beta.7",
4
+ "version": "3.5.0-beta.9",
5
5
  "description": "Trendyol Baklava Design System",
6
6
  "main": "dist/baklava.js",
7
7
  "module": "dist/baklava.js",
@@ -13,7 +13,10 @@
13
13
  "dist/"
14
14
  ],
15
15
  "homepage": "https://baklava.design",
16
- "repository": "github:Trendyol/baklava",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Trendyol/baklava.git"
19
+ },
17
20
  "bugs": {
18
21
  "url": "https://github.com/Trendyol/baklava/issues"
19
22
  },
@@ -55,7 +58,8 @@
55
58
  "test:debug": "web-test-runner --coverage --watch --debug",
56
59
  "test:headless": "web-test-runner --coverage --watch --debug --headless",
57
60
  "localize:extract": "lit-localize extract",
58
- "localize:build": "lit-localize build"
61
+ "localize:build": "lit-localize build",
62
+ "release": "semantic-release"
59
63
  },
60
64
  "keywords": [
61
65
  "web-components",
@@ -63,7 +67,7 @@
63
67
  "lit"
64
68
  ],
65
69
  "dependencies": {
66
- "@floating-ui/dom": "^1.2.3",
70
+ "@floating-ui/dom": "^1.7.6",
67
71
  "@fontsource-variable/rubik": "^5.0.2",
68
72
  "@lit-labs/react": "^2.0.3",
69
73
  "@lit/localize": "^0.12.1",
@@ -72,9 +76,6 @@
72
76
  "element-internals-polyfill": "^1.2.3",
73
77
  "lit": "^2.8.0"
74
78
  },
75
- "engines": {
76
- "node": ">=18"
77
- },
78
79
  "devDependencies": {
79
80
  "@commitlint/cli": "^16.2.4",
80
81
  "@commitlint/config-conventional": "^16.2.4",
@@ -133,6 +134,7 @@
133
134
  "react": "^18.2.0",
134
135
  "react-dom": "^18.2.0",
135
136
  "rollup-plugin-lit-css": "^4.0.0",
137
+ "semantic-release": "^25.0.5",
136
138
  "sinon": "^16.0.0",
137
139
  "storybook": "7.4.3",
138
140
  "stylelint": "^15.10.2",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}:host([disabled]) .datepicker-content{pointer-events:none}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n /**\n * Custom function to render day cells in the calendar.\n * It receives the date as an argument and should return a TemplateResult.\n */\n @property({ attribute: false })\n dayRenderer?: (date: Date) => TemplateResult;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._calendarEl?._dates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._calendarEl?._dates[0])\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n if (this._calendarEl?._dates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._calendarEl?._dates[1])}`;\n if (this._calendarEl?._dates[0] && this._calendarEl?._dates[1])\n this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._calendarEl?._dates.length - this._fittingDateCount;\n }\n\n setDatePickerInput() {\n if (!this._calendarEl?._dates.length) {\n this._inputValue = \"\";\n } else {\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._calendarEl?._dates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n }\n\n formatDate(date: Date): string {\n if (this.monthYearOnly) {\n return `${String(date?.getMonth() + 1).padStart(2, \"0\")}/${date?.getFullYear()}`;\n }\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._calendarEl.handleClearSelectedDates();\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts?.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._calendarEl?._dates) {\n this.setDatePickerInput();\n }\n }\n\n onCalendarChange() {\n this.setDatePickerInput();\n this._onBlDatepickerChange(this._calendarEl?._dates);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n .dayRenderer=${this.dayRenderer}\n ?month-year-only=${this.monthYearOnly}\n @bl-calendar-change=\"${this.onCalendarChange}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates =\n this._calendarEl?._dates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\") ?? \"\";\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._calendarEl?._dates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ?disabled=${this.disabled}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
5
- "mappings": "+NACO,IAAMA,EAASC,02BACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAoBrD,iBAAc,GAGd,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CA9F/B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EA+FI,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,YAAWP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,EAC9D,KAAK,wBAAwB,UACpB,KAAK,kBAAkC,CAChD,KAAK,iBAAiB,EACtB,IAAMQ,GAASP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAC9B,MAAM,EAAG,KAAK,mBACd,IAAIQ,GAAQ,KAAK,WAAWA,CAAI,GAEnC,KAAK,YAAcD,EAAO,KAAK,GAAG,GAAK,KAAK,mBAAqB,EAAI,QAAU,SACtE,KAAK,kB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K,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,QAAS,EAAK,CAAC,GAJhD7B,EAKnB,2BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GATtB7B,EAUnB,oBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAfjD7B,EAgBnB,0BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1C7B,EAqBnB,qBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvC7B,EA0BnB,8BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA9BvB7B,EA+BnB,wBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9C7B,EAoCnB,wBAOA4B,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GA1CX7B,EA2CnB,2BAGA4B,EAAA,CADCE,EAAM,GA7CY9B,EA8CnB,2BAGA4B,EAAA,CADCE,EAAM,GAhDY9B,EAiDnB,kCAGA4B,EAAA,CADCE,EAAM,GAnDY9B,EAoDnB,iCAGA4B,EAAA,CADCG,EAAM,aAAa,GAtDD/B,EAuDnB,2BAGA4B,EAAA,CADCG,EAAM,YAAY,GAzDA/B,EA0DnB,0BAGA4B,EAAA,CADCG,EAAM,UAAU,GA5DE/B,EA6DnB,wBAQuC4B,EAAA,CAAtCN,EAAM,sBAAsB,GArEVtB,EAqEoB,qCArEpBA,EAArB4B,EAAA,CADCC,EAAc,eAAe,GACT7B",
6
- "names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "values", "date", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "str", "parts", "acc", "part", "index", "x", "event", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
7
- }
@@ -1,37 +0,0 @@
1
- import{a as v}from"./chunk-6LT7O7T2.js";import{a as u}from"./chunk-DINNT5P2.js";import{a as h}from"./chunk-GRL4DWKG.js";import{a as d,b as o,c}from"./chunk-5MOOXA2X.js";import{a as p,b as e,f as l}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-IZ2LK5GK.js";var b=p`:host{display:block;position:relative;flex:1}.stepper-item{--item-color:var(--bl-color-neutral-light);--item-background:var(--bl-color-neutral-full);--active-color:var(--bl-color-primary);--hover-color:var(--bl-color-primary-highlight);--success-color:var(--bl-color-success);--error-color:var(--bl-color-danger);--disabled-color:var(--bl-color-neutral-lighter);--text-color-active:var(--bl-color-primary);--text-color-default:var(--bl-color-neutral-light);--description-color-active:var(--bl-color-neutral-darker);--description-color-default:var(--bl-color-neutral-light);display:flex;align-items:flex-start;gap:0;position:relative;background-color:transparent;padding:0;transition:.2s;width:100%;height:100%}.stepper-item.direction-horizontal{flex-direction:column;align-items:center;text-align:center;min-width:0}.stepper-item.direction-vertical{flex-direction:row;align-items:flex-start;text-align:left;width:100%}.vertical-layout{display:flex;flex-direction:row;align-items:stretch;gap:0;width:100%;height:100%}.stepper-item.direction-horizontal .connector-wrap{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:0;position:relative;width:100%;flex:1 1 auto;min-width:0}.stepper-item.direction-vertical .connector-wrap{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:0;position:relative;flex:0 0 auto;min-height:100%}.stepper-item.direction-vertical:last-child .connector-wrap{min-height:auto}.connector{background-color:var(--bl-color-neutral-lighter);transition:background-color .2s;flex-shrink:0}.connector.completed{background-color:var(--bl-color-neutral-dark)}.stepper-item.direction-horizontal .connector{height:2px;flex:1 1 auto;min-width:48px}.connector-placeholder{height:2px;flex:1 1 auto;min-width:48px;visibility:hidden}.stepper-item.direction-vertical .connector{width:2px;flex:1 1 auto;min-height:16px}.stepper-item.direction-vertical .connector-placeholder:first-child,.stepper-item.direction-vertical .connector:first-child{display:none}.stepper-indicator{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;min-height:32px;border-radius:50%;background-color:var(--item-background);border:2px solid var(--item-color);color:var(--item-color);font-weight:var(--bl-font-weight-medium);font-size:var(--bl-font-size-m);line-height:1;transition:.2s;flex-shrink:0;position:relative;z-index:2}.stepper-content{display:flex;flex-direction:column;gap:var(--bl-size-3xs);min-width:0;flex-shrink:0;margin-top:var(--bl-size-2xs);width:100%;text-align:center}.stepper-item.direction-vertical .stepper-content{margin-top:0;margin-left:var(--bl-size-xs);text-align:left;flex:1;padding-bottom:var(--bl-size-xl,24px);gap:0}.stepper-item.direction-vertical.type-dot .stepper-indicator{margin-top:2px}.stepper-title{font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);color:var(--text-color-default);line-height:1.5}.stepper-description{font-size:var(--bl-font-size-s);font-weight:var(--bl-font-weight-regular);color:var(--description-color-default);line-height:1.5}.step-dot{width:12px;height:12px;border-radius:50%;background-color:currentcolor;transition:.2s}.step-number{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);line-height:1}.step-icon{width:18px;height:18px;color:currentcolor;display:flex;align-items:center;justify-content:center}.stepper-item.variant-active .stepper-title{color:var(--text-color-active)}.stepper-item.variant-active .stepper-description{color:var(--description-color-active)}.stepper-item.variant-hover .stepper-title{color:var(--text-color-active)}.stepper-item.variant-hover .stepper-description{color:var(--description-color-active)}.stepper-item.variant-success .stepper-title{color:var(--success-color)}.stepper-item.variant-error .stepper-title{color:var(--error-color)}.stepper-item.disabled .stepper-indicator{border-color:var(--disabled-color);background-color:var(--item-background);color:var(--disabled-color)}.stepper-item.disabled .stepper-description,.stepper-item.disabled .stepper-title{color:var(--text-color-default)}.stepper-item.clickable{cursor:pointer}.stepper-item.clickable.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable:hover .stepper-indicator{transform:scale(1.05)}.stepper-item.clickable:focus{outline:0}.stepper-item.clickable:focus-visible .stepper-indicator{outline:2px solid var(--bl-color-primary);outline-offset:2px}.stepper-item.type-dot .stepper-indicator{width:12px!important;height:12px!important;min-width:12px!important;min-height:12px!important;border:none!important;background-color:var(--item-color);padding:0!important;border-radius:50%}.stepper-item.type-dot .step-dot{display:none}.stepper-item.type-number .stepper-indicator{border:2px solid var(--item-color);background-color:var(--item-background);color:var(--item-color)}.stepper-item.type-icon .stepper-indicator{border:none;background-color:var(--item-color);color:var(--item-background)}.stepper-item.variant-default.type-dot .stepper-indicator{background-color:var(--item-color)}.stepper-item.variant-hover.type-dot .stepper-indicator{background-color:var(--hover-color)}.stepper-item.clickable.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.type-dot:hover .stepper-indicator{background-color:var(--hover-color)!important}.stepper-item.clickable.variant-success.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-success.type-dot:hover .stepper-indicator{background-color:var(--success-color)!important}.stepper-item.clickable.variant-error.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-error.type-dot:hover .stepper-indicator{background-color:var(--error-color)!important}.stepper-item.clickable.variant-active.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-active.type-dot:hover .stepper-indicator{background-color:var(--active-color)!important}.stepper-item.variant-active.type-dot .stepper-indicator{background-color:var(--active-color)}.stepper-item.variant-success.type-dot .stepper-indicator{background-color:var(--success-color)}.stepper-item.variant-error.type-dot .stepper-indicator{background-color:var(--error-color)}.stepper-item.variant-default.type-number .stepper-indicator{border-color:var(--item-color);background-color:var(--item-background);color:var(--item-color)}.stepper-item.variant-hover.type-number .stepper-indicator{border-color:var(--active-color);background-color:var(--item-background);color:var(--active-color)}.stepper-item.variant-active.type-number .stepper-indicator{border-color:var(--active-color);background-color:var(--active-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-success.type-number .stepper-indicator{border-color:var(--success-color);background-color:var(--success-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-error.type-number .stepper-indicator{border-color:var(--error-color);background-color:var(--error-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-default.type-icon .stepper-indicator{background-color:var(--item-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-active.type-icon .stepper-indicator,.stepper-item.variant-hover.type-icon .stepper-indicator{background-color:var(--active-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-success.type-icon .stepper-indicator{background-color:var(--success-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-error.type-icon .stepper-indicator{background-color:var(--error-color);color:var(--bl-color-neutral-full)}:host([dir=rtl]) .stepper-item.direction-horizontal{text-align:center}:host([dir=rtl]) .stepper-item.direction-vertical{text-align:right}@media (max-width:768px){.stepper-item{padding:var(--bl-size-3xs)}.stepper-content{gap:var(--bl-size-4xs)}.stepper-title{font:var(--bl-font-body-text-3)}.stepper-description{font-size:var(--bl-font-size-s)}}`,m=b;var t=class extends l{constructor(){super(...arguments);this.id="";this.variant="default";this._internalVariant="default";this.disabled=!1;this.icon="check";this.title="";this.description="";this.showLeadingConnector=!1;this.showTrailingConnector=!0;this.stepperType="dot";this.direction="horizontal";this.stepUsage="clickable"}static get styles(){return[m]}static get shadowRootOptions(){return{...l.shadowRootOptions,delegatesFocus:!0}}willUpdate(r){super.willUpdate(r),r.has("variant")&&(this._internalVariant=this.variant)}get isClickable(){return!this.disabled&&this.variant!=="error"&&this.stepUsage==="clickable"}get stepNumber(){let r=this.parentElement;return r?Array.from(r.children).filter(a=>a.tagName.toLowerCase()==="bl-stepper-item").indexOf(this)+1:1}get shouldShowIcon(){return this.stepperType==="icon"?!0:this.stepperType==="number"?this.variant==="success"||this.variant==="error":!1}get iconName(){return this.stepperType==="icon"?this.icon:this.variant==="success"?"check":this.variant==="error"?"close":"check"}handleClick(r){this.isClickable&&(r.preventDefault(),r.stopPropagation(),this.onItemClick(this.id))}handleKeyDown(r){this.isClickable&&(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this.onItemClick(this.id))}handleMouseEnter(){this.isClickable&&this.variant==="default"&&(this._internalVariant="hover",this.requestUpdate())}handleMouseLeave(){this._internalVariant==="hover"&&(this._internalVariant="default",this.requestUpdate())}render(){let r={"stepper-item":!0,[`variant-${this._internalVariant}`]:!0,[`type-${this.stepperType}`]:!0,[`direction-${this.direction}`]:!0,disabled:this.disabled,clickable:this.isClickable},n=e`
2
- <div class="stepper-content">
3
- ${this.title?e`<div class="stepper-title">${this.title}</div>`:""}
4
- ${this.description?e`<div class="stepper-description">${this.description}</div>`:""}
5
- </div>
6
- `,a=this.variant==="success"||this.variant==="active"?"completed":"default",s=e`
7
- <div class="connector-wrap">
8
- ${this.direction==="horizontal"?e`
9
- ${this.showLeadingConnector?e`<div class="connector connector-leading ${a}"></div>`:e`<div class="connector-placeholder"></div>`}
10
- <div class="stepper-indicator">
11
- ${this.shouldShowIcon?e`<bl-icon name="${this.iconName}" class="step-icon"></bl-icon>`:this.stepperType==="number"?e`<span class="step-number">${this.stepNumber}</span>`:""}
12
- </div>
13
- ${this.showTrailingConnector?e`<div class="connector connector-trailing ${a}"></div>`:e`<div class="connector-placeholder"></div>`}
14
- `:e`
15
- ${this.showLeadingConnector?e`<div class="connector connector-leading ${a}"></div>`:""}
16
- <div class="stepper-indicator">
17
- ${this.shouldShowIcon?e`<bl-icon name="${this.iconName}" class="step-icon"></bl-icon>`:this.stepperType==="number"?e`<span class="step-number">${this.stepNumber}</span>`:""}
18
- </div>
19
- ${this.showTrailingConnector?e`<div class="connector connector-trailing ${a}"></div>`:""}
20
- `}
21
- </div>
22
- `;return e`
23
- <div
24
- class="${v(r)}"
25
- role="button"
26
- tabindex="${this.isClickable?"0":"-1"}"
27
- aria-label="${u(this.title||`Step ${this.stepNumber}`)}"
28
- aria-disabled="${this.disabled}"
29
- @click="${this.handleClick}"
30
- @keydown="${this.handleKeyDown}"
31
- @mouseenter="${this.handleMouseEnter}"
32
- @mouseleave="${this.handleMouseLeave}"
33
- >
34
- ${this.direction==="horizontal"?e` ${s} ${n} `:e` <div class="vertical-layout">${s} ${n}</div> `}
35
- </div>
36
- `}};i([o({type:String,reflect:!0})],t.prototype,"id",2),i([o({type:String,reflect:!0})],t.prototype,"variant",2),i([o({type:Boolean,reflect:!0})],t.prototype,"disabled",2),i([o({type:String})],t.prototype,"icon",2),i([o({type:String,reflect:!0})],t.prototype,"title",2),i([o({type:String,reflect:!0})],t.prototype,"description",2),i([c()],t.prototype,"showLeadingConnector",2),i([c()],t.prototype,"showTrailingConnector",2),i([c()],t.prototype,"stepperType",2),i([c()],t.prototype,"direction",2),i([c()],t.prototype,"stepUsage",2),i([h("bl-stepper-item-click")],t.prototype,"onItemClick",2),t=i([d("bl-stepper-item")],t);export{t as a};
37
- //# sourceMappingURL=chunk-3CGZ2A5B.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/components/stepper/bl-stepper-item.css", "../src/components/stepper/bl-stepper-item.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:block;position:relative;flex:1}.stepper-item{--item-color:var(--bl-color-neutral-light);--item-background:var(--bl-color-neutral-full);--active-color:var(--bl-color-primary);--hover-color:var(--bl-color-primary-highlight);--success-color:var(--bl-color-success);--error-color:var(--bl-color-danger);--disabled-color:var(--bl-color-neutral-lighter);--text-color-active:var(--bl-color-primary);--text-color-default:var(--bl-color-neutral-light);--description-color-active:var(--bl-color-neutral-darker);--description-color-default:var(--bl-color-neutral-light);display:flex;align-items:flex-start;gap:0;position:relative;background-color:transparent;padding:0;transition:.2s;width:100%;height:100%}.stepper-item.direction-horizontal{flex-direction:column;align-items:center;text-align:center;min-width:0}.stepper-item.direction-vertical{flex-direction:row;align-items:flex-start;text-align:left;width:100%}.vertical-layout{display:flex;flex-direction:row;align-items:stretch;gap:0;width:100%;height:100%}.stepper-item.direction-horizontal .connector-wrap{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:0;position:relative;width:100%;flex:1 1 auto;min-width:0}.stepper-item.direction-vertical .connector-wrap{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:0;position:relative;flex:0 0 auto;min-height:100%}.stepper-item.direction-vertical:last-child .connector-wrap{min-height:auto}.connector{background-color:var(--bl-color-neutral-lighter);transition:background-color .2s;flex-shrink:0}.connector.completed{background-color:var(--bl-color-neutral-dark)}.stepper-item.direction-horizontal .connector{height:2px;flex:1 1 auto;min-width:48px}.connector-placeholder{height:2px;flex:1 1 auto;min-width:48px;visibility:hidden}.stepper-item.direction-vertical .connector{width:2px;flex:1 1 auto;min-height:16px}.stepper-item.direction-vertical .connector-placeholder:first-child,.stepper-item.direction-vertical .connector:first-child{display:none}.stepper-indicator{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;min-height:32px;border-radius:50%;background-color:var(--item-background);border:2px solid var(--item-color);color:var(--item-color);font-weight:var(--bl-font-weight-medium);font-size:var(--bl-font-size-m);line-height:1;transition:.2s;flex-shrink:0;position:relative;z-index:2}.stepper-content{display:flex;flex-direction:column;gap:var(--bl-size-3xs);min-width:0;flex-shrink:0;margin-top:var(--bl-size-2xs);width:100%;text-align:center}.stepper-item.direction-vertical .stepper-content{margin-top:0;margin-left:var(--bl-size-xs);text-align:left;flex:1;padding-bottom:var(--bl-size-xl,24px);gap:0}.stepper-item.direction-vertical.type-dot .stepper-indicator{margin-top:2px}.stepper-title{font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);color:var(--text-color-default);line-height:1.5}.stepper-description{font-size:var(--bl-font-size-s);font-weight:var(--bl-font-weight-regular);color:var(--description-color-default);line-height:1.5}.step-dot{width:12px;height:12px;border-radius:50%;background-color:currentcolor;transition:.2s}.step-number{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);line-height:1}.step-icon{width:18px;height:18px;color:currentcolor;display:flex;align-items:center;justify-content:center}.stepper-item.variant-active .stepper-title{color:var(--text-color-active)}.stepper-item.variant-active .stepper-description{color:var(--description-color-active)}.stepper-item.variant-hover .stepper-title{color:var(--text-color-active)}.stepper-item.variant-hover .stepper-description{color:var(--description-color-active)}.stepper-item.variant-success .stepper-title{color:var(--success-color)}.stepper-item.variant-error .stepper-title{color:var(--error-color)}.stepper-item.disabled .stepper-indicator{border-color:var(--disabled-color);background-color:var(--item-background);color:var(--disabled-color)}.stepper-item.disabled .stepper-description,.stepper-item.disabled .stepper-title{color:var(--text-color-default)}.stepper-item.clickable{cursor:pointer}.stepper-item.clickable.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable:hover .stepper-indicator{transform:scale(1.05)}.stepper-item.clickable:focus{outline:0}.stepper-item.clickable:focus-visible .stepper-indicator{outline:2px solid var(--bl-color-primary);outline-offset:2px}.stepper-item.type-dot .stepper-indicator{width:12px!important;height:12px!important;min-width:12px!important;min-height:12px!important;border:none!important;background-color:var(--item-color);padding:0!important;border-radius:50%}.stepper-item.type-dot .step-dot{display:none}.stepper-item.type-number .stepper-indicator{border:2px solid var(--item-color);background-color:var(--item-background);color:var(--item-color)}.stepper-item.type-icon .stepper-indicator{border:none;background-color:var(--item-color);color:var(--item-background)}.stepper-item.variant-default.type-dot .stepper-indicator{background-color:var(--item-color)}.stepper-item.variant-hover.type-dot .stepper-indicator{background-color:var(--hover-color)}.stepper-item.clickable.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.type-dot:hover .stepper-indicator{background-color:var(--hover-color)!important}.stepper-item.clickable.variant-success.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-success.type-dot:hover .stepper-indicator{background-color:var(--success-color)!important}.stepper-item.clickable.variant-error.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-error.type-dot:hover .stepper-indicator{background-color:var(--error-color)!important}.stepper-item.clickable.variant-active.type-dot.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .stepper-indicator,.stepper-item.clickable.variant-active.type-dot:hover .stepper-indicator{background-color:var(--active-color)!important}.stepper-item.variant-active.type-dot .stepper-indicator{background-color:var(--active-color)}.stepper-item.variant-success.type-dot .stepper-indicator{background-color:var(--success-color)}.stepper-item.variant-error.type-dot .stepper-indicator{background-color:var(--error-color)}.stepper-item.variant-default.type-number .stepper-indicator{border-color:var(--item-color);background-color:var(--item-background);color:var(--item-color)}.stepper-item.variant-hover.type-number .stepper-indicator{border-color:var(--active-color);background-color:var(--item-background);color:var(--active-color)}.stepper-item.variant-active.type-number .stepper-indicator{border-color:var(--active-color);background-color:var(--active-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-success.type-number .stepper-indicator{border-color:var(--success-color);background-color:var(--success-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-error.type-number .stepper-indicator{border-color:var(--error-color);background-color:var(--error-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-default.type-icon .stepper-indicator{background-color:var(--item-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-active.type-icon .stepper-indicator,.stepper-item.variant-hover.type-icon .stepper-indicator{background-color:var(--active-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-success.type-icon .stepper-indicator{background-color:var(--success-color);color:var(--bl-color-neutral-full)}.stepper-item.variant-error.type-icon .stepper-indicator{background-color:var(--error-color);color:var(--bl-color-neutral-full)}:host([dir=rtl]) .stepper-item.direction-horizontal{text-align:center}:host([dir=rtl]) .stepper-item.direction-vertical{text-align:right}@media (max-width:768px){.stepper-item{padding:var(--bl-size-3xs)}.stepper-content{gap:var(--bl-size-4xs)}.stepper-title{font:var(--bl-font-body-text-3)}.stepper-description{font-size:var(--bl-font-size-s)}}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport style from \"./bl-stepper-item.css\";\n\nexport type StepperItemVariant = \"default\" | \"active\" | \"success\" | \"error\";\ntype InternalStepperItemVariant = StepperItemVariant | \"hover\";\nexport type StepperType = \"dot\" | \"number\" | \"icon\";\nexport type StepperDirection = \"horizontal\" | \"vertical\";\n\n/**\n * @tag bl-stepper-item\n * @summary Baklava Stepper Item component for individual steps in a stepper\n *\n * @slot default - Step content (title and description)\n */\n\n@customElement(\"bl-stepper-item\")\nexport default class BlStepperItem extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * @internal\n */\n static get shadowRootOptions() {\n return { ...LitElement.shadowRootOptions, delegatesFocus: true };\n }\n\n /**\n * Defines stepper item's id\n */\n @property({ type: String, reflect: true })\n id: string = \"\";\n\n /**\n * Defines stepper item's status\n */\n @property({ type: String, reflect: true })\n variant: StepperItemVariant = \"default\";\n\n /**\n * Internal variant state that includes hover\n * @internal\n */\n private _internalVariant: InternalStepperItemVariant = \"default\";\n\n /**\n * Defines stepper item's interaction\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * If stepper type is icon, it should be rendered on stepper items\n */\n @property({ type: String })\n icon: BaklavaIcon = \"check\";\n\n /**\n * Defines stepper item's main title\n */\n @property({ type: String, reflect: true })\n title = \"\";\n\n /**\n * Defines stepper item's description\n */\n @property({ type: String, reflect: true })\n description = \"\";\n\n /**\n * Internal state to show leading connector (line before the step)\n * @internal\n */\n @state()\n showLeadingConnector = false;\n\n /**\n * Internal state to show trailing connector (line after the step)\n * @internal\n */\n @state()\n showTrailingConnector = true;\n\n /**\n * Internal state to track stepper type from parent\n * @internal\n */\n @state()\n stepperType: StepperType = \"dot\";\n\n /**\n * Internal state to track stepper direction from parent\n * @internal\n */\n @state()\n direction: StepperDirection = \"horizontal\";\n\n /**\n * Internal state to track stepper usage from parent\n * @internal\n */\n @state()\n stepUsage: \"clickable\" | \"non-clickable\" = \"clickable\";\n\n /**\n * Fires when stepper item is clicked\n */\n @event(\"bl-stepper-item-click\") private onItemClick: EventDispatcher<string>;\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n\n // Sync internal variant with public variant\n if (changedProperties.has(\"variant\")) {\n this._internalVariant = this.variant;\n }\n }\n\n private get isClickable(): boolean {\n return !this.disabled && this.variant !== \"error\" && this.stepUsage === \"clickable\";\n }\n\n /**\n * @internal\n */\n get stepNumber(): number {\n const parent = this.parentElement;\n\n if (!parent) return 1;\n\n const items = Array.from(parent.children).filter(\n child => child.tagName.toLowerCase() === \"bl-stepper-item\"\n );\n\n return items.indexOf(this) + 1;\n }\n\n /**\n * @internal\n */\n get shouldShowIcon(): boolean {\n if (this.stepperType === \"icon\") {\n return true;\n }\n if (this.stepperType === \"number\") {\n return this.variant === \"success\" || this.variant === \"error\";\n }\n return false;\n }\n\n /**\n * @internal\n */\n get iconName(): BaklavaIcon {\n if (this.stepperType === \"icon\") {\n return this.icon;\n }\n if (this.variant === \"success\") {\n return \"check\";\n }\n if (this.variant === \"error\") {\n return \"close\";\n }\n return \"check\";\n }\n\n private handleClick(event: Event) {\n if (!this.isClickable) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n this.onItemClick(this.id);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (!this.isClickable) {\n return;\n }\n\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n this.onItemClick(this.id);\n }\n }\n\n private handleMouseEnter() {\n if (this.isClickable && this.variant === \"default\") {\n this._internalVariant = \"hover\";\n this.requestUpdate();\n }\n }\n\n private handleMouseLeave() {\n if (this._internalVariant === \"hover\") {\n this._internalVariant = \"default\";\n this.requestUpdate();\n }\n }\n\n render(): TemplateResult {\n const classes = {\n \"stepper-item\": true,\n [`variant-${this._internalVariant}`]: true,\n [`type-${this.stepperType}`]: true,\n [`direction-${this.direction}`]: true,\n disabled: this.disabled,\n clickable: this.isClickable,\n };\n\n const content = html`\n <div class=\"stepper-content\">\n ${this.title ? html`<div class=\"stepper-title\">${this.title}</div>` : \"\"}\n ${this.description ? html`<div class=\"stepper-description\">${this.description}</div>` : \"\"}\n </div>\n `;\n\n const connectorState =\n this.variant === \"success\" || this.variant === \"active\" ? \"completed\" : \"default\";\n\n const stepIndicator = html`\n <div class=\"connector-wrap\">\n ${this.direction === \"horizontal\"\n ? html`\n ${this.showLeadingConnector\n ? html`<div class=\"connector connector-leading ${connectorState}\"></div>`\n : html`<div class=\"connector-placeholder\"></div>`}\n <div class=\"stepper-indicator\">\n ${this.shouldShowIcon\n ? html`<bl-icon name=\"${this.iconName}\" class=\"step-icon\"></bl-icon>`\n : this.stepperType === \"number\"\n ? html`<span class=\"step-number\">${this.stepNumber}</span>`\n : \"\"}\n </div>\n ${this.showTrailingConnector\n ? html`<div class=\"connector connector-trailing ${connectorState}\"></div>`\n : html`<div class=\"connector-placeholder\"></div>`}\n `\n : html`\n ${this.showLeadingConnector\n ? html`<div class=\"connector connector-leading ${connectorState}\"></div>`\n : \"\"}\n <div class=\"stepper-indicator\">\n ${this.shouldShowIcon\n ? html`<bl-icon name=\"${this.iconName}\" class=\"step-icon\"></bl-icon>`\n : this.stepperType === \"number\"\n ? html`<span class=\"step-number\">${this.stepNumber}</span>`\n : \"\"}\n </div>\n ${this.showTrailingConnector\n ? html`<div class=\"connector connector-trailing ${connectorState}\"></div>`\n : \"\"}\n `}\n </div>\n `;\n\n return html`\n <div\n class=\"${classMap(classes)}\"\n role=\"button\"\n tabindex=\"${this.isClickable ? \"0\" : \"-1\"}\"\n aria-label=\"${ifDefined(this.title || `Step ${this.stepNumber}`)}\"\n aria-disabled=\"${this.disabled}\"\n @click=\"${this.handleClick}\"\n @keydown=\"${this.handleKeyDown}\"\n @mouseenter=\"${this.handleMouseEnter}\"\n @mouseleave=\"${this.handleMouseLeave}\"\n >\n ${this.direction === \"horizontal\"\n ? html` ${stepIndicator} ${content} `\n : html` <div class=\"vertical-layout\">${stepIndicator} ${content}</div> `}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-stepper-item\": BlStepperItem;\n }\n}\n"],
5
- "mappings": "uQACO,IAAMA,EAASC,s/PACfC,EAAQF,ECoBf,IAAqBG,EAArB,cAA2CC,CAAW,CAAtD,kCAgBE,QAAa,GAMb,aAA8B,UAM9B,KAAQ,iBAA+C,UAMvD,cAAW,GAMX,UAAoB,QAMpB,WAAQ,GAMR,iBAAc,GAOd,0BAAuB,GAOvB,2BAAwB,GAOxB,iBAA2B,MAO3B,eAA8B,aAO9B,eAA2C,YAtF3C,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAKA,WAAW,mBAAoB,CAC7B,MAAO,CAAE,GAAGD,EAAW,kBAAmB,eAAgB,EAAK,CACjE,CAoFA,WAAWE,EAA2D,CACpE,MAAM,WAAWA,CAAiB,EAG9BA,EAAkB,IAAI,SAAS,IACjC,KAAK,iBAAmB,KAAK,QAEjC,CAEA,IAAY,aAAuB,CACjC,MAAO,CAAC,KAAK,UAAY,KAAK,UAAY,SAAW,KAAK,YAAc,WAC1E,CAKA,IAAI,YAAqB,CACvB,IAAMC,EAAS,KAAK,cAEpB,OAAKA,EAES,MAAM,KAAKA,EAAO,QAAQ,EAAE,OACxCC,GAASA,EAAM,QAAQ,YAAY,IAAM,iBAC3C,EAEa,QAAQ,IAAI,EAAI,EANT,CAOtB,CAKA,IAAI,gBAA0B,CAC5B,OAAI,KAAK,cAAgB,OA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,EAuFnB,yBAKwCc,EAAA,CAAvCR,EAAM,uBAAuB,GA5FXN,EA4FqB,2BA5FrBA,EAArBc,EAAA,CADCC,EAAc,iBAAiB,GACXf",
6
- "names": ["styles", "i", "bl_stepper_item_default", "BlStepperItem", "s", "bl_stepper_item_default", "changedProperties", "parent", "child", "event", "classes", "content", "x", "connectorState", "stepIndicator", "o", "l", "__decorateClass", "e", "t"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../node_modules/@open-wc/form-helpers/src/index.ts", "../src/components/button/bl-button.css", "../src/components/button/bl-button.ts"],
4
- "sourcesContent": ["/**\n * Implicitly submit a form by first validating all controls. If the form\n * is valid, issue a submit event and if that event is not prevented, manually\n * call the form's submit method.\n *\n * @param form {HTMLFormElement} - A form to implicitly submit\n */\nexport const submit = (form: HTMLFormElement): void => {\n if (!form.noValidate && !form.reportValidity()) {\n return;\n } else {\n const submitEvent = new SubmitEvent('submit', {\n bubbles: true,\n cancelable: true\n });\n form.dispatchEvent(submitEvent);\n if (!submitEvent.defaultPrevented) {\n form.submit();\n }\n }\n};\n\nexport type FormValue = string|FormData|File|FormValue[];\n\n/**\n * Parse a form and return a set of values based on the name/value pair.\n * If multiple controls of a similar name exist, return an array for those values;\n * otherwise return a single value.\n *\n * @param form {HTMLFormElement} - The form to parse for values\n * @returns {Record<string, any>} - An object representing the form's current values\n */\nexport const formValues = (form: HTMLFormElement): Record<string, FormValue> => {\n const formData = new FormData(form);\n const values: Record<string, FormValue> = {};\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This does exist in all browsers. TypeScript is wrong\n for (const [key, value] of formData.entries()) {\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n const pointer = values[key] as FormValue[];\n pointer.push(value);\n } else {\n values[key] = [values[key], value];\n }\n }\n\n return values;\n};\n\n/**\n * This method takes a form and parses it as an object. If any form control has a `.`\n * in its name, this utility will evaluate that name as a deep key for an object;\n * in other words, if a form has a named control, `name.first` and another, `name.last`\n * it will report back a nested object, name, with first and last properties\n * representing those controls' values.\n *\n * This can be useful when you have a complex model that you are attempting to represent\n * in declaratively in HTML.\n *\n * @param form {HTMLFormElement} - The form to grab values from\n * @returns {Object<string, FormValue>} - An object representation of the form\n */\nexport const parseFormAsObject = (form: HTMLFormElement): Record<string, FormValue> => {\n const data = formValues(form);\n const output: Record<string, FormValue> = {};\n\n Object.entries(data).forEach(([key, value]) => {\n /** If the key has a '.', parse it as an object */\n if (key.includes('.')) {\n const path = key.split('.');\n const destination: string | undefined = path.pop();\n let pointer = output;\n\n while (path.length) {\n const key = path.shift();\n pointer[key as string] = pointer[key as string] || ({} as FormValue);\n pointer = pointer[key as string] as unknown as Record<string, FormValue>;\n }\n\n pointer[destination as string] = value;\n } else {\n output[key] = data[key];\n }\n });\n\n return output;\n};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:var(--bl-button-display,inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-highlight);--text-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify,center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);min-width:var(--height);border:solid 1px var(--border-color);border-radius:var(--bl-border-radius-m);text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button,:host(:hover) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size=small]) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size=large]) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:0}.button:focus-visible{position:relative;outline:0}.button:focus-visible::after{border:2px solid var(--bl-button-focus-border-color,var(--main-color));border-radius:var(--bl-border-radius-l);content:\"\";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant=secondary]) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant=tertiary]) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind=neutral]) .button{--main-color:var(--bl-color-neutral-darker);--main-hover-color:var(--bl-color-neutral-darkest)}:host([kind=success]) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-highlight)}:host([kind=danger]) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-highlight)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host .button[aria-disabled=true]{--main-color:var(--bl-color-neutral-lightest);--main-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-lighter);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant=tertiary]) .button[aria-disabled=true]{--main-color:transparent}:host([variant=secondary].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=false],:host([variant=secondary]:hover) .button[aria-disabled=false]{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=tertiary].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=false],:host([variant=tertiary]:hover) .button[aria-disabled=false]{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant=secondary]) .active.button{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=tertiary]) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-neutral-lightest);--border-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport \"../spinner/bl-spinner\";\nimport style from \"./bl-button.css\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\";\nexport type ButtonKind = \"default\" | \"neutral\" | \"success\" | \"danger\";\nexport type ButtonSize = \"small\" | \"medium\" | \"large\";\nexport type TargetType = \"_blank\" | \"_parent\" | \"_self\" | \"_top\";\n\n/**\n * @tag bl-button\n * @summary Baklava Button component\n *\n * @cssproperty [--bl-button-display=inline-block] Sets the display property of button\n * @cssproperty [--bl-button-justify=center] Sets the justify-content property of button\n *\n */\n@customElement(\"bl-button\")\nexport default class BlButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * Sets the button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Sets the button label. Used for accessibility.\n */\n @property({ type: String })\n label: string;\n\n /**\n * Sets the button label for loading status.\n */\n @property({ type: String, attribute: \"loading-label\" })\n loadingLabel: string;\n\n /**\n * Sets loading state of button\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Set link url. If set, button will be rendered as anchor tag.\n */\n @property({ type: String })\n href?: string;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: BaklavaIcon;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = \"_self\";\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: \"submit\";\n\n /**\n * Sets button type to dropdown\n */\n @property({ type: Boolean })\n dropdown = false;\n\n /**\n * Sets button to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.\n */\n @property({ type: String })\n form: HTMLFormElement | string;\n\n /**\n * Active state\n */\n @state({})\n active = false;\n\n @query(\".button\")\n private button: HTMLAnchorElement | HTMLButtonElement;\n\n /**\n * Fires when button clicked\n */\n @event(\"bl-click\") private onClick: EventDispatcher<string>;\n\n private get _isActive() {\n return this.active;\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n private caretTemplate(): TemplateResult {\n return html` <bl-icon class=\"open\" name=\"arrow_up\"></bl-icon>\n <bl-icon class=\"close\" name=\"arrow_down\"></bl-icon>`;\n }\n\n private _handleClick() {\n if (this.type === \"submit\") {\n let targetForm: HTMLFormElement;\n\n if (this.form instanceof HTMLFormElement) {\n targetForm = this.form;\n } else if (typeof this.form === \"string\") {\n targetForm = document.getElementById(this.form) as HTMLFormElement;\n } else {\n targetForm = this.closest(\"form\") as HTMLFormElement;\n }\n\n if (targetForm) {\n submit(targetForm);\n }\n }\n\n this.onClick(\"Click event fired!\");\n }\n\n focus() {\n this.button.focus();\n }\n\n get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n get _hasDefaultSlot() {\n const childNodes = [...this.childNodes];\n\n return childNodes.some(node => {\n const nodeType = node.nodeType;\n\n // has only text node.\n if (nodeType === node.TEXT_NODE && node.textContent?.trim() !== \"\") {\n return true;\n }\n // has element node, it should not have slot attribute.\n if (nodeType === node.ELEMENT_NODE) {\n if (!(node as HTMLElement).hasAttribute(\"slot\")) {\n return true;\n }\n }\n return false;\n });\n }\n\n render(): TemplateResult {\n const isDisabled = this.loading || this.disabled;\n const label = this.loading && this.loadingLabel ? this.loadingLabel : html`<slot></slot>`;\n const isAnchor = !!this.href;\n const icon = this.icon ? html`<bl-icon name=${this.icon}></bl-icon>` : \"\";\n const loadingIcon = html`<bl-spinner\n class=\"loading-spinner\"\n ?disabled=\"${isDisabled}\"\n size=\"${this.size}\"\n ></bl-spinner>`;\n const slots = html`<slot name=\"icon\">${this.loading ? loadingIcon : icon}</slot>\n <span class=\"label\">${label}</span>`;\n const caret = this.dropdown ? this.caretTemplate() : \"\";\n const classes = classMap({\n \"button\": true,\n \"has-icon\": this.icon || this._hasIconSlot,\n \"has-content\": this._hasDefaultSlot,\n \"active\": !isAnchor && this._isActive,\n });\n\n return isAnchor\n ? html`<a\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n role=\"button\"\n >${slots}\n </a>`\n : html`<button\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n ?disabled=${isDisabled}\n @click=\"${this._handleClick}\"\n >\n ${slots} ${caret}\n </button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-button\": BlButton;\n }\n}\n"],
5
- "mappings": "mRAOO,IAAMA,EAAUC,GAA+B,CACpD,GAAI,GAACA,EAAK,YA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AtCvBnB,EAuCnB,uBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA5CvBnB,EA6CnB,wBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GAlDPnB,EAmDnB,oBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GAxDPnB,EAyDnB,oBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GA9DPnB,EA+DnB,sBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GApEPnB,EAqEnB,oBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA1ERnB,EA2EnB,wBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhFvBnB,EAiFnB,yBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtFPnB,EAuFnB,oBAMAmB,EAAA,CADCC,EAAM,CAAC,CAAC,GA5FUpB,EA6FnB,sBAGQmB,EAAA,CADPE,EAAM,SAAS,GA/FGrB,EAgGX,sBAKmBmB,EAAA,CAA1BG,EAAM,UAAU,GArGEtB,EAqGQ,uBArGRA,EAArBmB,EAAA,CADCI,EAAc,WAAW,GACLvB",
6
- "names": ["submit", "form", "submitEvent", "styles", "i", "bl_button_default", "BlButton", "s", "bl_button_default", "x", "targetForm", "submit", "node", "_a", "nodeType", "isDisabled", "label", "isAnchor", "icon", "loadingIcon", "slots", "caret", "classes", "o", "l", "__decorateClass", "t", "i", "event", "e"]
7
- }
@@ -1,2 +0,0 @@
1
- var D=Math.min,O=Math.max,tt=Math.round,et=Math.floor,Y=t=>({x:t,y:t}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},Bt={start:"end",end:"start"};function st(t,e,n){return O(t,D(e,n))}function $(t,e){return typeof t=="function"?t(e):t}function F(t){return t.split("-")[0]}function _(t){return t.split("-")[1]}function dt(t){return t==="x"?"y":"x"}function rt(t){return t==="y"?"height":"width"}function q(t){return["top","bottom"].includes(F(t))?"y":"x"}function ct(t){return dt(q(t))}function ht(t,e,n){n===void 0&&(n=!1);let o=_(t),i=ct(t),s=rt(i),r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=Z(r)),[r,Z(r)]}function pt(t){let e=Z(t);return[it(t),e,it(e)]}function it(t){return t.replace(/start|end/g,e=>Bt[e])}function Ft(t,e,n){let o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function xt(t,e,n,o){let i=_(t),s=Ft(F(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(it)))),s}function Z(t){return t.replace(/left|right|bottom|top/g,e=>Mt[e])}function Nt(t){return{top:0,right:0,bottom:0,left:0,...t}}function lt(t){return typeof t!="number"?Nt(t):{top:t,right:t,bottom:t,left:t}}function j(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function wt(t,e,n){let{reference:o,floating:i}=t,s=q(e),r=ct(e),l=rt(r),c=F(e),f=s==="y",d=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2,a;switch(c){case"top":a={x:d,y:o.y-i.height};break;case"bottom":a={x:d,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(_(e)){case"start":a[r]-=h*(n&&f?-1:1);break;case"end":a[r]+=h*(n&&f?-1:1);break}return a}var yt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e)),f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=wt(f,o,c),h=o,a={},m=0;for(let g=0;g<l.length;g++){let{name:x,fn:p}=l[g],{x:w,y,data:A,reset:v}=await p({x:d,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:a,rects:f,platform:r,elements:{reference:t,floating:e}});if(d=w!=null?w:d,u=y!=null?y:u,a={...a,[x]:{...a[x],...A}},v&&m<=50){m++,typeof v=="object"&&(v.placement&&(h=v.placement),v.rects&&(f=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:u}=wt(f,h,c)),g=-1;continue}}return{x:d,y:u,placement:h,strategy:i,middlewareData:a}};async function ft(t,e){var n;e===void 0&&(e={});let{x:o,y:i,platform:s,rects:r,elements:l,strategy:c}=t,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:a=0}=$(e,t),m=lt(a),x=l[h?u==="floating"?"reference":"floating":u],p=j(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:f,rootBoundary:d,strategy:c})),w=u==="floating"?{...r.floating,x:o,y:i}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},v=j(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:y,strategy:c}):w);return{top:(p.top-v.top+m.top)/A.y,bottom:(v.bottom-p.bottom+m.bottom)/A.y,left:(p.left-v.left+m.left)/A.x,right:(v.right-p.right+m.right)/A.x}}var Wt=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:o,placement:i,rects:s,platform:r,elements:l,middlewareData:c}=e,{element:f,padding:d=0}=$(t,e)||{};if(f==null)return{};let u=lt(d),h={x:n,y:o},a=ct(i),m=rt(a),g=await r.getDimensions(f),x=a==="y",p=x?"top":"left",w=x?"bottom":"right",y=x?"clientHeight":"clientWidth",A=s.reference[m]+s.reference[a]-h[a]-s.floating[m],v=h[a]-s.reference[a],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(f)),R=b?b[y]:0;(!R||!await(r.isElement==null?void 0:r.isElement(b)))&&(R=l.floating[y]||s.floating[m]);let M=A/2-v/2,W=R/2-g[m]/2-1,C=D(u[p],W),z=D(u[w],W),T=C,I=R-g[m]-z,E=R/2-g[m]/2+M,S=st(T,E,I),L=!c.arrow&&_(i)!=null&&E!=S&&s.reference[m]/2-(E<T?C:z)-g[m]/2<0,B=L?E<T?E-T:E-I:0;return{[a]:h[a]+B,data:{[a]:S,centerOffset:E-S-B,...L&&{alignmentOffset:B}},reset:L}}});var Ht=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;let{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:c,elements:f}=e,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:a="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...x}=$(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};let p=F(i),w=F(l)===l,y=await(c.isRTL==null?void 0:c.isRTL(f.floating)),A=h||(w||!g?[Z(l)]:pt(l));!h&&m!=="none"&&A.push(...xt(l,g,m,y));let v=[l,...A],b=await ft(e,x),R=[],M=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&R.push(b[p]),u){let T=ht(i,r,y);R.push(b[T[0]],b[T[1]])}if(M=[...M,{placement:i,overflows:R}],!R.every(T=>T<=0)){var W,C;let T=(((W=s.flip)==null?void 0:W.index)||0)+1,I=v[T];if(I)return{data:{index:T,overflows:M},reset:{placement:I}};let E=(C=M.filter(S=>S.overflows[0]<=0).sort((S,L)=>S.overflows[1]-L.overflows[1])[0])==null?void 0:C.placement;if(!E)switch(a){case"bestFit":{var z;let S=(z=M.map(L=>[L.placement,L.overflows.filter(B=>B>0).reduce((B,mt)=>B+mt,0)]).sort((L,B)=>L[1]-B[1])[0])==null?void 0:z[0];S&&(E=S);break}case"initialPlacement":E=l;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function vt(t){let e=D(...t.map(s=>s.left)),n=D(...t.map(s=>s.top)),o=O(...t.map(s=>s.right)),i=O(...t.map(s=>s.bottom));return{x:e,y:n,width:o-e,height:i-n}}function Vt(t){let e=t.slice().sort((i,s)=>i.y-s.y),n=[],o=null;for(let i=0;i<e.length;i++){let s=e[i];!o||s.y-o.y>o.height/2?n.push([s]):n[n.length-1].push(s),o=s}return n.map(i=>j(vt(i)))}var zt=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){let{placement:n,elements:o,rects:i,platform:s,strategy:r}=e,{padding:l=2,x:c,y:f}=$(t,e),d=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(o.reference))||[]),u=Vt(d),h=j(vt(d)),a=lt(l);function m(){if(u.length===2&&u[0].left>u[1].right&&c!=null&&f!=null)return u.find(x=>c>x.left-a.left&&c<x.right+a.right&&f>x.top-a.top&&f<x.bottom+a.bottom)||h;if(u.length>=2){if(q(n)==="y"){let C=u[0],z=u[u.length-1],T=F(n)==="top",I=C.top,E=z.bottom,S=T?C.left:z.left,L=T?C.right:z.right,B=L-S,mt=E-I;return{top:I,bottom:E,left:S,right:L,width:B,height:mt,x:S,y:I}}let x=F(n)==="left",p=O(...u.map(C=>C.right)),w=D(...u.map(C=>C.left)),y=u.filter(C=>x?C.left===w:C.right===p),A=y[0].top,v=y[y.length-1].bottom,b=w,R=p,M=R-b,W=v-A;return{top:A,bottom:v,left:b,right:R,width:M,height:W,x:b,y:A}}return h}let g=await s.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:r});return i.reference.x!==g.reference.x||i.reference.y!==g.reference.y||i.reference.width!==g.reference.width||i.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}};async function It(t,e){let{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=F(n),l=_(n),c=q(n)==="y",f=["left","top"].includes(r)?-1:1,d=s&&c?-1:1,u=$(e,t),{mainAxis:h,crossAxis:a,alignmentAxis:m}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&typeof m=="number"&&(a=l==="end"?m*-1:m),c?{x:a*d,y:h*f}:{x:h*f,y:a*d}}var Yt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){let{x:n,y:o}=e,i=await It(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},jt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:x=>{let{x:p,y:w}=x;return{x:p,y:w}}},...c}=$(t,e),f={x:n,y:o},d=await ft(e,c),u=q(F(i)),h=dt(u),a=f[h],m=f[u];if(s){let x=h==="y"?"top":"left",p=h==="y"?"bottom":"right",w=a+d[x],y=a-d[p];a=st(w,a,y)}if(r){let x=u==="y"?"top":"left",p=u==="y"?"bottom":"right",w=m+d[x],y=m-d[p];m=st(w,m,y)}let g=l.fn({...e,[h]:a,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o}}}}};var Xt=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){let{placement:n,rects:o,platform:i,elements:s}=e,{apply:r=()=>{},...l}=$(t,e),c=await ft(e,l),f=F(n),d=_(n),u=q(n)==="y",{width:h,height:a}=o.floating,m,g;f==="top"||f==="bottom"?(m=f,g=d===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(g=f,m=d==="end"?"top":"bottom");let x=a-c[m],p=h-c[g],w=!e.middlewareData.shift,y=x,A=p;if(u){let b=h-c.left-c.right;A=d||w?D(p,b):b}else{let b=a-c.top-c.bottom;y=d||w?D(x,b):b}if(w&&!d){let b=O(c.left,0),R=O(c.right,0),M=O(c.top,0),W=O(c.bottom,0);u?A=h-2*(b!==0||R!==0?b+R:O(c.left,c.right)):y=a-2*(M!==0||W!==0?M+W:O(c.top,c.bottom))}await r({...e,availableWidth:A,availableHeight:y});let v=await i.getDimensions(s.floating);return h!==v.width||a!==v.height?{reset:{rects:!0}}:{}}}};function X(t){return At(t)?(t.nodeName||"").toLowerCase():"#document"}function P(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function H(t){var e;return(e=(At(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function At(t){return t instanceof Node||t instanceof P(t).Node}function V(t){return t instanceof Element||t instanceof P(t).Element}function N(t){return t instanceof HTMLElement||t instanceof P(t).HTMLElement}function bt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof P(t).ShadowRoot}function J(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Ot(t){return["table","td","th"].includes(X(t))}function at(t){let e=ut(),n=k(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Rt(t){let e=K(t);for(;N(e)&&!nt(e);){if(at(e))return e;e=K(e)}return null}function ut(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nt(t){return["html","body","#document"].includes(X(t))}function k(t){return P(t).getComputedStyle(t)}function ot(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function K(t){if(X(t)==="html")return t;let e=t.assignedSlot||t.parentNode||bt(t)&&t.host||H(t);return bt(e)?e.host:e}function Ct(t){let e=K(t);return nt(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&J(e)?e:Ct(e)}function G(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Ct(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=P(i);return s?e.concat(r,r.visualViewport||[],J(i)?i:[],r.frameElement&&n?G(r.frameElement):[]):e.concat(i,G(i,[],n))}function St(t){let e=k(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=N(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,l=tt(n)!==s||tt(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function gt(t){return V(t)?t:t.contextElement}function Q(t){let e=gt(t);if(!N(e))return Y(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:s}=St(e),r=(s?tt(n.width):n.width)/o,l=(s?tt(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}var $t=Y(0);function Pt(t){let e=P(t);return!ut()||!e.visualViewport?$t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _t(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==P(t)?!1:e}function U(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),s=gt(t),r=Y(1);e&&(o?V(o)&&(r=Q(o)):r=Q(t));let l=_t(s,n,o)?Pt(s):Y(0),c=(i.left+l.x)/r.x,f=(i.top+l.y)/r.y,d=i.width/r.x,u=i.height/r.y;if(s){let h=P(s),a=o&&V(o)?P(o):o,m=h.frameElement;for(;m&&o&&a!==h;){let g=Q(m),x=m.getBoundingClientRect(),p=k(m),w=x.left+(m.clientLeft+parseFloat(p.paddingLeft))*g.x,y=x.top+(m.clientTop+parseFloat(p.paddingTop))*g.y;c*=g.x,f*=g.y,d*=g.x,u*=g.y,c+=w,f+=y,m=P(m).frameElement}}return j({width:d,height:u,x:c,y:f})}function qt(t){let{rect:e,offsetParent:n,strategy:o}=t,i=N(n),s=H(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},l=Y(1),c=Y(0);if((i||!i&&o!=="fixed")&&((X(n)!=="body"||J(s))&&(r=ot(n)),N(n))){let f=U(n);l=Q(n),c.x=f.x+n.clientLeft,c.y=f.y+n.clientTop}return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-r.scrollLeft*l.x+c.x,y:e.y*l.y-r.scrollTop*l.y+c.y}}function Kt(t){return Array.from(t.getClientRects())}function Lt(t){return U(H(t)).left+ot(t).scrollLeft}function Ut(t){let e=H(t),n=ot(t),o=t.ownerDocument.body,i=O(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=O(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),r=-n.scrollLeft+Lt(t),l=-n.scrollTop;return k(o).direction==="rtl"&&(r+=O(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}function Gt(t,e){let n=P(t),o=H(t),i=n.visualViewport,s=o.clientWidth,r=o.clientHeight,l=0,c=0;if(i){s=i.width,r=i.height;let f=ut();(!f||f&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:s,height:r,x:l,y:c}}function Jt(t,e){let n=U(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=N(t)?Q(t):Y(1),r=t.clientWidth*s.x,l=t.clientHeight*s.y,c=i*s.x,f=o*s.y;return{width:r,height:l,x:c,y:f}}function Et(t,e,n){let o;if(e==="viewport")o=Gt(t,n);else if(e==="document")o=Ut(H(t));else if(V(e))o=Jt(e,n);else{let i=Pt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return j(o)}function Dt(t,e){let n=K(t);return n===e||!V(n)||nt(n)?!1:k(n).position==="fixed"||Dt(n,e)}function Qt(t,e){let n=e.get(t);if(n)return n;let o=G(t,[],!1).filter(l=>V(l)&&X(l)!=="body"),i=null,s=k(t).position==="fixed",r=s?K(t):t;for(;V(r)&&!nt(r);){let l=k(r),c=at(r);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&Dt(t,r))?o=o.filter(d=>d!==r):i=l,r=K(r)}return e.set(t,o),o}function Zt(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,r=[...n==="clippingAncestors"?Qt(e,this._c):[].concat(n),o],l=r[0],c=r.reduce((f,d)=>{let u=Et(e,d,i);return f.top=O(u.top,f.top),f.right=D(u.right,f.right),f.bottom=D(u.bottom,f.bottom),f.left=O(u.left,f.left),f},Et(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function te(t){return St(t)}function ee(t,e,n){let o=N(e),i=H(e),s=n==="fixed",r=U(t,!0,s,e),l={scrollLeft:0,scrollTop:0},c=Y(0);if(o||!o&&!s)if((X(e)!=="body"||J(i))&&(l=ot(e)),o){let f=U(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Lt(i));return{x:r.left+l.scrollLeft-c.x,y:r.top+l.scrollTop-c.y,width:r.width,height:r.height}}function Tt(t,e){return!N(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function kt(t,e){let n=P(t);if(!N(t))return n;let o=Tt(t,e);for(;o&&Ot(o)&&k(o).position==="static";)o=Tt(o,e);return o&&(X(o)==="html"||X(o)==="body"&&k(o).position==="static"&&!at(o))?n:o||Rt(t)||n}var ne=async function(t){let{reference:e,floating:n,strategy:o}=t,i=this.getOffsetParent||kt,s=this.getDimensions;return{reference:ee(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function oe(t){return k(t).direction==="rtl"}var ie={convertOffsetParentRelativeRectToViewportRelativeRect:qt,getDocumentElement:H,getClippingRect:Zt,getOffsetParent:kt,getElementRects:ne,getClientRects:Kt,getDimensions:te,getScale:Q,isElement:V,isRTL:oe};function se(t,e){let n=null,o,i=H(t);function s(){clearTimeout(o),n&&n.disconnect(),n=null}function r(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();let{left:f,top:d,width:u,height:h}=t.getBoundingClientRect();if(l||e(),!u||!h)return;let a=et(d),m=et(i.clientWidth-(f+u)),g=et(i.clientHeight-(d+h)),x=et(f),w={rootMargin:-a+"px "+-m+"px "+-g+"px "+-x+"px",threshold:O(0,D(1,c))||1},y=!0;function A(v){let b=v[0].intersectionRatio;if(b!==c){if(!y)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},100)}y=!1}try{n=new IntersectionObserver(A,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,w)}n.observe(t)}return r(!0),s}function ye(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=gt(t),d=i||s?[...f?G(f):[],...G(e)]:[];d.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),s&&p.addEventListener("resize",n)});let u=f&&l?se(f,n):null,h=-1,a=null;r&&(a=new ResizeObserver(p=>{let[w]=p;w&&w.target===f&&a&&(a.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{a&&a.observe(e)})),n()}),f&&!c&&a.observe(f),a.observe(e));let m,g=c?U(t):null;c&&x();function x(){let p=U(t);g&&(p.x!==g.x||p.y!==g.y||p.width!==g.width||p.height!==g.height)&&n(),g=p,m=requestAnimationFrame(x)}return n(),()=>{d.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),u&&u(),a&&a.disconnect(),a=null,c&&cancelAnimationFrame(m)}}var ve=(t,e,n)=>{let o=new Map,i={platform:ie,...n},s={...i.platform,_c:o};return yt(t,e,{...i,platform:s})};export{Wt as a,Ht as b,zt as c,Yt as d,jt as e,Xt as f,ye as g,ve as h};
2
- //# sourceMappingURL=chunk-EZSEQHRH.js.map