@budibase/bbui 2.2.12-alpha.6 → 2.2.12-alpha.60

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 (54) hide show
  1. package/dist/bbui.es.js +3 -3
  2. package/dist/bbui.es.js.map +1 -1
  3. package/package.json +4 -3
  4. package/src/Accordion/Accordion.svelte +58 -0
  5. package/src/ActionButton/ActionButton.svelte +2 -3
  6. package/src/ActionMenu/ActionMenu.svelte +1 -2
  7. package/src/Actions/click_outside.js +28 -9
  8. package/src/Actions/position_dropdown.js +54 -53
  9. package/src/Avatar/Avatar.svelte +1 -0
  10. package/src/Button/Button.svelte +8 -4
  11. package/src/Drawer/DrawerContent.svelte +0 -1
  12. package/src/FancyForm/FancyButton.svelte +30 -0
  13. package/src/FancyForm/FancyButtonRadio.svelte +70 -0
  14. package/src/FancyForm/FancyCheckbox.svelte +53 -0
  15. package/src/FancyForm/FancyField.svelte +126 -0
  16. package/src/FancyForm/FancyFieldLabel.svelte +25 -0
  17. package/src/FancyForm/FancyForm.svelte +40 -0
  18. package/src/FancyForm/FancyInput.svelte +77 -0
  19. package/src/FancyForm/FancySelect.svelte +147 -0
  20. package/src/FancyForm/index.js +6 -0
  21. package/src/Form/Core/DatePicker.svelte +1 -1
  22. package/src/Form/Core/EnvDropdown.svelte +276 -0
  23. package/src/Form/Core/Picker.svelte +141 -124
  24. package/src/Form/Core/Select.svelte +3 -0
  25. package/src/Form/Core/Switch.svelte +0 -2
  26. package/src/Form/Core/TextField.svelte +0 -6
  27. package/src/Form/EnvDropdown.svelte +50 -0
  28. package/src/Form/Input.svelte +0 -2
  29. package/src/Form/InputDropdown.svelte +0 -2
  30. package/src/Form/PickerDropdown.svelte +0 -2
  31. package/src/Form/Toggle.svelte +1 -2
  32. package/src/Icon/IconAvatar.svelte +3 -0
  33. package/src/InlineAlert/InlineAlert.svelte +1 -0
  34. package/src/Label/Label.svelte +1 -0
  35. package/src/Layout/Page.svelte +82 -13
  36. package/src/Link/Link.svelte +4 -1
  37. package/src/List/ListItem.svelte +6 -3
  38. package/src/Menu/Item.svelte +0 -2
  39. package/src/Modal/CustomContent.svelte +0 -1
  40. package/src/Modal/Modal.svench +0 -1
  41. package/src/Modal/ModalContent.svelte +4 -4
  42. package/src/Modal/QuizModal.svelte +0 -1
  43. package/src/Popover/Popover.svelte +45 -39
  44. package/src/Popover/Popover.svench +0 -1
  45. package/src/SideNavigation/Item.svelte +0 -2
  46. package/src/Table/StringRenderer.svelte +9 -1
  47. package/src/Table/Table.svelte +30 -19
  48. package/src/Tabs/Tab.svelte +5 -5
  49. package/src/Tags/Tag.svelte +1 -1
  50. package/src/Tags/Tags.svelte +10 -0
  51. package/src/Typography/Heading.svelte +6 -0
  52. package/src/bbui.css +7 -3
  53. package/src/context.js +1 -0
  54. package/src/index.js +5 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/bbui",
3
3
  "description": "A UI solution used in the different Budibase projects.",
4
- "version": "2.2.12-alpha.6",
4
+ "version": "2.2.12-alpha.60",
5
5
  "license": "MPL-2.0",
6
6
  "svelte": "src/index.js",
7
7
  "module": "dist/bbui.es.js",
@@ -38,7 +38,8 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@adobe/spectrum-css-workflow-icons": "1.2.1",
41
- "@budibase/string-templates": "2.2.12-alpha.6",
41
+ "@budibase/string-templates": "2.2.12-alpha.60",
42
+ "@spectrum-css/accordion": "3.0.24",
42
43
  "@spectrum-css/actionbutton": "1.0.1",
43
44
  "@spectrum-css/actiongroup": "1.0.1",
44
45
  "@spectrum-css/avatar": "3.0.2",
@@ -88,5 +89,5 @@
88
89
  "resolutions": {
89
90
  "loader-utils": "1.4.1"
90
91
  },
91
- "gitHead": "7c4bdc242d85ce707a9b8b0bb7581f8ef1d1e728"
92
+ "gitHead": "67b888c7fea58424bdd3763e83fde40bf7f7a6a2"
92
93
  }
@@ -0,0 +1,58 @@
1
+ <script>
2
+ import "@spectrum-css/accordion"
3
+
4
+ export let itemName
5
+ export let initialOpen
6
+ export let header
7
+
8
+ let isOpen
9
+
10
+ function getOpenClass(isOpen) {
11
+ if (isOpen === undefined) {
12
+ isOpen = initialOpen
13
+ }
14
+ return isOpen ? "is-open" : ""
15
+ }
16
+ </script>
17
+
18
+ <div class="spectrum-Accordion" role={itemName}>
19
+ <div class="spectrum-Accordion-item {getOpenClass(isOpen)}">
20
+ <h3 class="spectrum-Accordion-itemHeading">
21
+ <button
22
+ class="spectrum-Accordion-itemHeader"
23
+ type="button"
24
+ on:click={() => (isOpen = !isOpen)}
25
+ >
26
+ {header}
27
+ </button>
28
+ <svg
29
+ class="spectrum-Icon spectrum-UIIcon-ChevronRight100 spectrum-Accordion-itemIndicator"
30
+ focusable="false"
31
+ aria-hidden="true"
32
+ >
33
+ <use xlink:href="#spectrum-css-icon-Chevron100" />
34
+ </svg>
35
+ </h3>
36
+ <div class="spectrum-Accordion-itemContent" role={itemName}>
37
+ <slot />
38
+ </div>
39
+ </div>
40
+ </div>
41
+
42
+ <style>
43
+ .spectrum-Accordion {
44
+ margin-left: -20px;
45
+ }
46
+ .spectrum-Accordion-item {
47
+ border: none;
48
+ }
49
+ .spectrum-Accordion-itemContent {
50
+ width: 97%;
51
+ padding-left: 30px;
52
+ }
53
+ .spectrum-Accordion-itemHeader {
54
+ text-transform: none;
55
+ font-weight: bold;
56
+ font-size: 0.875rem;
57
+ }
58
+ </style>
@@ -9,7 +9,6 @@
9
9
  export let longPressable = false
10
10
  export let disabled = false
11
11
  export let icon = ""
12
- export let dataCy = null
13
12
  export let size = "M"
14
13
  export let active = false
15
14
  export let fullWidth = false
@@ -37,7 +36,6 @@
37
36
  </script>
38
37
 
39
38
  <button
40
- data-cy={dataCy}
41
39
  use:longPress
42
40
  class:spectrum-ActionButton--quiet={quiet}
43
41
  class:spectrum-ActionButton--emphasized={emphasized}
@@ -86,8 +84,9 @@
86
84
  margin-left: 0;
87
85
  transition: color ease-out 130ms;
88
86
  }
89
- .is-selected:not(.spectrum-ActionButton--emphasized) {
87
+ .is-selected:not(.spectrum-ActionButton--emphasized):not(.spectrum-ActionButton--quiet) {
90
88
  background: var(--spectrum-global-color-gray-300);
89
+ border-color: var(--spectrum-global-color-gray-700);
91
90
  }
92
91
  .noPadding {
93
92
  padding: 0;
@@ -6,7 +6,6 @@
6
6
  export let disabled = false
7
7
  export let align = "left"
8
8
  export let portalTarget
9
- export let dataCy
10
9
 
11
10
  let anchor
12
11
  let dropdown
@@ -37,7 +36,7 @@
37
36
  <div use:getAnchor on:click={openMenu}>
38
37
  <slot name="control" />
39
38
  </div>
40
- <Popover bind:this={dropdown} {anchor} {align} {portalTarget} {dataCy}>
39
+ <Popover bind:this={dropdown} {anchor} {align} {portalTarget}>
41
40
  <Menu>
42
41
  <slot />
43
42
  </Menu>
@@ -1,11 +1,11 @@
1
- const ignoredClasses = [".flatpickr-calendar", ".modal-container"]
1
+ const ignoredClasses = [".flatpickr-calendar", ".spectrum-Popover"]
2
2
  let clickHandlers = []
3
3
 
4
4
  /**
5
5
  * Handle a body click event
6
6
  */
7
7
  const handleClick = event => {
8
- // Ignore click if needed
8
+ // Ignore click if this is an ignored class
9
9
  for (let className of ignoredClasses) {
10
10
  if (event.target.closest(className)) {
11
11
  return
@@ -14,9 +14,18 @@ const handleClick = event => {
14
14
 
15
15
  // Process handlers
16
16
  clickHandlers.forEach(handler => {
17
- if (!handler.element.contains(event.target)) {
18
- handler.callback?.(event)
17
+ if (handler.element.contains(event.target)) {
18
+ return
19
+ }
20
+
21
+ // Ignore clicks for modals, unless the handler is registered from a modal
22
+ const sourceInModal = handler.anchor.closest(".spectrum-Modal") != null
23
+ const clickInModal = event.target.closest(".spectrum-Modal") != null
24
+ if (clickInModal && !sourceInModal) {
25
+ return
19
26
  }
27
+
28
+ handler.callback?.(event)
20
29
  })
21
30
  }
22
31
  document.documentElement.addEventListener("click", handleClick, true)
@@ -24,10 +33,10 @@ document.documentElement.addEventListener("click", handleClick, true)
24
33
  /**
25
34
  * Adds or updates a click handler
26
35
  */
27
- const updateHandler = (id, element, callback) => {
36
+ const updateHandler = (id, element, anchor, callback) => {
28
37
  let existingHandler = clickHandlers.find(x => x.id === id)
29
38
  if (!existingHandler) {
30
- clickHandlers.push({ id, element, callback })
39
+ clickHandlers.push({ id, element, anchor, callback })
31
40
  } else {
32
41
  existingHandler.callback = callback
33
42
  }
@@ -42,12 +51,22 @@ const removeHandler = id => {
42
51
 
43
52
  /**
44
53
  * Svelte action to apply a click outside handler for a certain element
54
+ * opts.anchor is an optional param specifying the real root source of the
55
+ * component being observed. This is required for things like popovers, where
56
+ * the element using the clickoutside action is the popover, but the popover is
57
+ * rendered at the root of the DOM somewhere, whereas the popover anchor is the
58
+ * element we actually want to consider when determining the source component.
45
59
  */
46
- export default (element, callback) => {
60
+ export default (element, opts) => {
47
61
  const id = Math.random()
48
- updateHandler(id, element, callback)
62
+ const update = newOpts => {
63
+ const callback = newOpts?.callback || newOpts
64
+ const anchor = newOpts?.anchor || element
65
+ updateHandler(id, element, anchor, callback)
66
+ }
67
+ update(opts)
49
68
  return {
50
- update: newCallback => updateHandler(id, element, newCallback),
69
+ update,
51
70
  destroy: () => removeHandler(id),
52
71
  }
53
72
  }
@@ -1,75 +1,76 @@
1
- export default function positionDropdown(element, { anchor, align, maxWidth }) {
2
- let positionSide = "top"
3
- let maxHeight = 0
4
- let dimensions = getDimensions(anchor)
5
-
6
- function getDimensions() {
7
- const {
8
- bottom,
9
- top: spaceAbove,
10
- left,
11
- width,
12
- } = anchor.getBoundingClientRect()
13
- const spaceBelow = window.innerHeight - bottom
14
- const containerRect = element.getBoundingClientRect()
15
-
16
- let y
1
+ export default function positionDropdown(
2
+ element,
3
+ { anchor, align, maxWidth, useAnchorWidth, offset = 5 }
4
+ ) {
5
+ const update = () => {
6
+ if (!anchor) {
7
+ return
8
+ }
9
+ const anchorBounds = anchor.getBoundingClientRect()
10
+ const elementBounds = element.getBoundingClientRect()
11
+ let styles = {
12
+ maxHeight: null,
13
+ minWidth: null,
14
+ maxWidth,
15
+ left: null,
16
+ top: null,
17
+ }
17
18
 
18
- if (spaceAbove > spaceBelow) {
19
- positionSide = "bottom"
20
- maxHeight = spaceAbove - 20
21
- y = window.innerHeight - spaceAbove + 5
19
+ // Determine vertical styles
20
+ if (align === "right-outside") {
21
+ styles.top = anchorBounds.top
22
+ } else if (window.innerHeight - anchorBounds.bottom < 100) {
23
+ styles.top = anchorBounds.top - elementBounds.height - offset
22
24
  } else {
23
- positionSide = "top"
24
- y = bottom + 5
25
- maxHeight = spaceBelow - 20
25
+ styles.top = anchorBounds.bottom + offset
26
+ styles.maxHeight = window.innerHeight - anchorBounds.bottom - 20
26
27
  }
27
28
 
28
- return {
29
- [positionSide]: y,
30
- left,
31
- width,
32
- containerWidth: containerRect.width,
29
+ // Determine horizontal styles
30
+ if (!maxWidth && useAnchorWidth) {
31
+ styles.maxWidth = anchorBounds.width
33
32
  }
34
- }
35
-
36
- function calcLeftPosition() {
37
- let left
38
-
39
- if (align == "right") {
40
- left = dimensions.left + dimensions.width - dimensions.containerWidth
41
- } else if (align == "right-side") {
42
- left = dimensions.left + dimensions.width
33
+ if (useAnchorWidth) {
34
+ styles.minWidth = anchorBounds.width
35
+ }
36
+ if (align === "right") {
37
+ styles.left = anchorBounds.left + anchorBounds.width - elementBounds.width
38
+ } else if (align === "right-outside") {
39
+ styles.left = anchorBounds.right + offset
43
40
  } else {
44
- left = dimensions.left
41
+ styles.left = anchorBounds.left
45
42
  }
46
43
 
47
- return left
44
+ // Apply styles
45
+ Object.entries(styles).forEach(([style, value]) => {
46
+ if (value) {
47
+ element.style[style] = `${value.toFixed(0)}px`
48
+ } else {
49
+ element.style[style] = null
50
+ }
51
+ })
48
52
  }
49
53
 
54
+ // Apply initial styles which don't need to change
50
55
  element.style.position = "absolute"
51
56
  element.style.zIndex = "9999"
52
- if (maxWidth) {
53
- element.style.maxWidth = `${maxWidth}px`
54
- }
55
- element.style.minWidth = `${dimensions.width}px`
56
- element.style.maxHeight = `${maxHeight.toFixed(0)}px`
57
- element.style.transformOrigin = `center ${positionSide}`
58
- element.style[positionSide] = `${dimensions[positionSide]}px`
59
- element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
60
57
 
58
+ // Observe both anchor and element and resize the popover as appropriate
61
59
  const resizeObserver = new ResizeObserver(entries => {
62
- entries.forEach(() => {
63
- dimensions = getDimensions()
64
- element.style[positionSide] = `${dimensions[positionSide]}px`
65
- element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px`
66
- })
60
+ entries.forEach(update)
67
61
  })
68
- resizeObserver.observe(anchor)
62
+ if (anchor) {
63
+ resizeObserver.observe(anchor)
64
+ }
69
65
  resizeObserver.observe(element)
66
+ resizeObserver.observe(document.body)
67
+
68
+ document.addEventListener("scroll", update, true)
69
+
70
70
  return {
71
71
  destroy() {
72
72
  resizeObserver.disconnect()
73
+ document.removeEventListener("scroll", update, true)
73
74
  },
74
75
  }
75
76
  }
@@ -58,5 +58,6 @@
58
58
  overflow: hidden;
59
59
  user-select: none;
60
60
  text-transform: uppercase;
61
+ flex-shrink: 0;
61
62
  }
62
63
  </style>
@@ -13,13 +13,14 @@
13
13
  export let icon = undefined
14
14
  export let active = false
15
15
  export let tooltip = undefined
16
- export let dataCy
17
- export let newStyles = false
16
+ export let newStyles = true
17
+ export let id
18
18
 
19
19
  let showTooltip = false
20
20
  </script>
21
21
 
22
22
  <button
23
+ {id}
23
24
  class:spectrum-Button--cta={cta}
24
25
  class:spectrum-Button--primary={primary}
25
26
  class:spectrum-Button--secondary={secondary}
@@ -28,9 +29,9 @@
28
29
  class:spectrum-Button--quiet={quiet}
29
30
  class:new-styles={newStyles}
30
31
  class:active
32
+ class:disabled
31
33
  class="spectrum-Button spectrum-Button--size{size.toUpperCase()}"
32
34
  {disabled}
33
- data-cy={dataCy}
34
35
  on:click|preventDefault
35
36
  on:mouseover={() => (showTooltip = true)}
36
37
  on:focus={() => (showTooltip = true)}
@@ -108,7 +109,10 @@
108
109
  border-color: transparent;
109
110
  color: var(--spectrum-global-color-gray-900);
110
111
  }
111
- .spectrum-Button--secondary.new-styles:hover {
112
+ .spectrum-Button--secondary.new-styles:not(.disabled):hover {
112
113
  background: var(--spectrum-global-color-gray-300);
113
114
  }
115
+ .spectrum-Button--secondary.new-styles.disabled {
116
+ color: var(--spectrum-global-color-gray-500);
117
+ }
114
118
  </style>
@@ -34,7 +34,6 @@
34
34
  display: none;
35
35
  }
36
36
  .main {
37
- font-family: var(--font-sans);
38
37
  padding: var(--spacing-xl);
39
38
  }
40
39
  .main :global(textarea) {
@@ -0,0 +1,30 @@
1
+ <script>
2
+ import Icon from "../Icon/Icon.svelte"
3
+ import FancyField from "./FancyField.svelte"
4
+
5
+ export let icon
6
+ export let disabled
7
+ </script>
8
+
9
+ <FancyField on:click clickable {disabled}>
10
+ {#if icon}
11
+ {#if icon.includes("/")}
12
+ <img src={icon} alt="button" />
13
+ {:else}
14
+ <Icon name={icon} />
15
+ {/if}
16
+ {/if}
17
+ <slot name="icon" />
18
+ <div>
19
+ <slot />
20
+ </div>
21
+ </FancyField>
22
+
23
+ <style>
24
+ img {
25
+ width: 22px;
26
+ }
27
+ div {
28
+ font-size: var(--font-size-l);
29
+ }
30
+ </style>
@@ -0,0 +1,70 @@
1
+ <script>
2
+ import { createEventDispatcher } from "svelte"
3
+ import FancyField from "./FancyField.svelte"
4
+ import FancyFieldLabel from "./FancyFieldLabel.svelte"
5
+ import ActionButton from "../ActionButton/ActionButton.svelte"
6
+
7
+ export let label
8
+ export let value
9
+ export let disabled = false
10
+ export let error = null
11
+ export let validate = null
12
+ export let options = []
13
+ export let getOptionLabel = option => extractProperty(option, "label")
14
+ export let getOptionValue = option => extractProperty(option, "value")
15
+
16
+ const dispatch = createEventDispatcher()
17
+
18
+ $: placeholder = !value
19
+
20
+ const extractProperty = (value, property) => {
21
+ if (value && typeof value === "object") {
22
+ return value[property]
23
+ }
24
+ return value
25
+ }
26
+
27
+ const onChange = newValue => {
28
+ dispatch("change", newValue)
29
+ value = newValue
30
+ if (validate) {
31
+ error = validate(newValue)
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <FancyField {error} {value} {validate} {disabled} autoHeight>
37
+ {#if label}
38
+ <FancyFieldLabel placeholder={false}>{label}</FancyFieldLabel>
39
+ {/if}
40
+
41
+ <div class="options">
42
+ {#each options as option}
43
+ <ActionButton
44
+ selected={getOptionValue(option) === value}
45
+ on:click={() => onChange(getOptionValue(option))}
46
+ >
47
+ {getOptionLabel(option)}
48
+ </ActionButton>
49
+ {/each}
50
+ </div>
51
+ </FancyField>
52
+
53
+ <style>
54
+ .options {
55
+ margin-top: 34px;
56
+ margin-bottom: 14px;
57
+ display: flex;
58
+ flex-direction: row;
59
+ justify-content: flex-start;
60
+ align-items: center;
61
+ gap: 6px;
62
+ flex-wrap: wrap;
63
+ }
64
+ .options :global(.spectrum-ActionButton) {
65
+ font-size: 15px;
66
+ line-height: 17px;
67
+ height: auto;
68
+ padding: 6px 10px;
69
+ }
70
+ </style>
@@ -0,0 +1,53 @@
1
+ <script>
2
+ import { createEventDispatcher } from "svelte"
3
+ import FancyField from "./FancyField.svelte"
4
+ import Checkbox from "../Form/Core/Checkbox.svelte"
5
+
6
+ export let value
7
+ export let text
8
+ export let disabled = false
9
+ export let error = null
10
+ export let validate = null
11
+
12
+ const dispatch = createEventDispatcher()
13
+
14
+ const onChange = () => {
15
+ const newValue = !value
16
+ dispatch("change", newValue)
17
+ value = newValue
18
+ if (validate) {
19
+ error = validate(newValue)
20
+ }
21
+ }
22
+ </script>
23
+
24
+ <FancyField {error} {value} {validate} {disabled} clickable on:click={onChange}>
25
+ <span>
26
+ <Checkbox {disabled} {value} />
27
+ </span>
28
+ <div class="text">
29
+ {#if text}
30
+ {text}
31
+ {/if}
32
+ <slot />
33
+ </div>
34
+ </FancyField>
35
+
36
+ <style>
37
+ span {
38
+ pointer-events: none;
39
+ }
40
+ .text {
41
+ font-size: 15px;
42
+ line-height: 17px;
43
+ overflow: hidden;
44
+ text-overflow: ellipsis;
45
+ display: -webkit-box;
46
+ -webkit-line-clamp: 2;
47
+ line-clamp: 2;
48
+ -webkit-box-orient: vertical;
49
+ }
50
+ .text > :global(*) {
51
+ font-size: inherit !important;
52
+ }
53
+ </style>
@@ -0,0 +1,126 @@
1
+ <script>
2
+ import Icon from "../Icon/Icon.svelte"
3
+ import { getContext, onMount } from "svelte"
4
+ import { slide } from "svelte/transition"
5
+
6
+ export let disabled = false
7
+ export let error = null
8
+ export let focused = false
9
+ export let clickable = false
10
+ export let validate
11
+ export let value
12
+ export let ref
13
+ export let autoHeight
14
+
15
+ const formContext = getContext("fancy-form")
16
+ const id = Math.random()
17
+ const API = {
18
+ validate: () => {
19
+ if (validate) {
20
+ error = validate(value)
21
+ }
22
+ return !error
23
+ },
24
+ }
25
+
26
+ onMount(() => {
27
+ if (formContext) {
28
+ formContext.registerField(id, API)
29
+ }
30
+ return () => {
31
+ if (formContext) {
32
+ formContext.unregisterField(id)
33
+ }
34
+ }
35
+ })
36
+ </script>
37
+
38
+ <div
39
+ bind:this={ref}
40
+ class="fancy-field"
41
+ class:error
42
+ class:disabled
43
+ class:focused
44
+ class:clickable
45
+ class:auto-height={autoHeight}
46
+ >
47
+ <div class="content" on:click>
48
+ <div class="field">
49
+ <slot />
50
+ </div>
51
+ {#if error}
52
+ <div class="error-icon">
53
+ <Icon name="Alert" />
54
+ </div>
55
+ {/if}
56
+ </div>
57
+ {#if error}
58
+ <div transition:slide|local={{ duration: 130 }} class="error-message">
59
+ {error}
60
+ </div>
61
+ {/if}
62
+ </div>
63
+
64
+ <style>
65
+ .fancy-field {
66
+ max-width: 400px;
67
+ background: var(--spectrum-global-color-gray-75);
68
+ border: 1px solid var(--spectrum-global-color-gray-300);
69
+ border-radius: 4px;
70
+ box-sizing: border-box;
71
+ transition: border-color 130ms ease-out, background 130ms ease-out,
72
+ background 130ms ease-out;
73
+ color: var(--spectrum-global-color-gray-800);
74
+ }
75
+ .fancy-field:hover {
76
+ border-color: var(--spectrum-global-color-gray-400);
77
+ }
78
+ .fancy-field.clickable:hover {
79
+ background: var(--spectrum-global-color-gray-200);
80
+ cursor: pointer;
81
+ }
82
+ .fancy-field.focused {
83
+ border-color: var(--spectrum-global-color-blue-400);
84
+ }
85
+ .fancy-field.error {
86
+ border-color: var(--spectrum-global-color-red-400);
87
+ }
88
+ .fancy-field.disabled {
89
+ background: var(--spectrum-global-color-gray-200);
90
+ color: var(--spectrum-global-color-gray-400);
91
+ border: 1px solid var(--spectrum-global-color-gray-300);
92
+ pointer-events: none;
93
+ }
94
+ .content {
95
+ position: relative;
96
+ height: 64px;
97
+ padding: 0 16px;
98
+ }
99
+ .fancy-field.auto-height .content {
100
+ height: auto;
101
+ }
102
+ .content,
103
+ .field {
104
+ display: flex;
105
+ flex-direction: row;
106
+ justify-content: flex-start;
107
+ align-items: center;
108
+ gap: 16px;
109
+ }
110
+ .field {
111
+ flex: 1 1 auto;
112
+ }
113
+ .error-message {
114
+ background: var(--spectrum-global-color-red-400);
115
+ color: white;
116
+ font-size: 14px;
117
+ padding: 6px 16px;
118
+ font-weight: 500;
119
+ }
120
+ .error-icon {
121
+ flex: 0 0 auto;
122
+ }
123
+ .error-icon :global(.spectrum-Icon) {
124
+ fill: var(--spectrum-global-color-red-400);
125
+ }
126
+ </style>