@sevenfold/setto-client 0.8.2 → 0.8.3

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.
@@ -56,3 +56,30 @@ export interface SettoFormProps {
56
56
  classNames?: SettoFormClassNames;
57
57
  }
58
58
  export declare function SettoForm({ formId, fields: propFields, endpoint, endpointKey, className, classNames, }: SettoFormProps): import("react/jsx-runtime").JSX.Element;
59
+ /**
60
+ * Enough that an unstyled form looks intentional, while still losing to
61
+ * anything the site says on purpose. Colours lean on `currentColor`, so the
62
+ * form follows whatever section it sits in, light or dark.
63
+ *
64
+ * Every rule is scoped under `.setto-form`, which is not decoration: written
65
+ * at the zero specificity of a bare `:where()`, these rules lost to Tailwind's
66
+ * Preflight — `button, input, optgroup, select, textarea { padding: 0 }` is an
67
+ * element selector, and an element selector outranks nothing at all. Every
68
+ * generated site ships Preflight, so every form went out with no padding on
69
+ * its fields or its button. Simon, on a real site: "the form in the bottom
70
+ * seems unstyled."
71
+ *
72
+ * So the sheet is in two halves, and which half a property lands in is decided
73
+ * by who it has to beat.
74
+ *
75
+ * SHAPE — padding, width, radius, the things Preflight strips — is scoped
76
+ * `.setto-form :where(…)`. That scores one class, which beats an element
77
+ * selector, and puts back exactly what the reset took away.
78
+ *
79
+ * COLOUR — background, border colour, text colour — stays at zero specificity,
80
+ * because here the site really must win. The generator emits `bg-card` and
81
+ * `text-foreground` on these very elements, and scoping those under a class
82
+ * would tie on weight and then beat them on order, quietly discarding the
83
+ * palette the build chose. Shape is ours; colour is theirs.
84
+ */
85
+ export declare const BASE_CSS = "\n.setto-form{display:grid;gap:1.1rem;position:relative}\n.setto-form :where(.setto-form__field){display:grid;gap:.4rem;position:relative}\n.setto-form :where(.setto-form__label,.setto-form__legend){font-weight:500;line-height:1.3;padding:0}\n.setto-form :where(.setto-form__required){opacity:.6;margin-left:.15em}\n.setto-form :where(.setto-form__input,.setto-form__textarea,.setto-form__select){width:100%;box-sizing:border-box;padding:.7rem .85rem;border-width:1px;border-style:solid;border-radius:.6rem;font:inherit;line-height:1.4}\n.setto-form :where(.setto-form__textarea){min-height:7.5rem;resize:vertical}\n.setto-form :where(.setto-form__fieldset){border:0;padding:0;margin:0;min-width:0;display:grid;gap:.5rem}\n.setto-form :where(.setto-form__options){display:grid;gap:.5rem}\n.setto-form :where(.setto-form__option,.setto-form__check){display:flex;gap:.6rem;align-items:flex-start;line-height:1.4;cursor:pointer;font-weight:400}\n.setto-form :where(.setto-form__option input,.setto-form__check input){margin:.25em 0 0;flex:none;accent-color:currentColor}\n.setto-form :where(.setto-form__actions){display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:center}\n.setto-form :where(.setto-form__button){cursor:pointer;font:inherit;font-weight:500;padding:.75rem 1.4rem;border-radius:999px;border-width:1px;border-style:solid}\n.setto-form :where(.setto-form__success){display:grid;gap:.75rem;justify-items:start;outline:none}\n.setto-form :where(.setto-form__success-icon){width:2.5rem;height:2.5rem}\n.setto-form :where(.setto-form__success-text){margin:0;font-size:1.05em}\n.setto-form :where(.setto-form__hp){position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}\n:where(.setto-form__input,.setto-form__textarea,.setto-form__select){border-color:color-mix(in srgb,currentColor 28%,transparent);background:color-mix(in srgb,currentColor 4%,transparent);color:inherit}\n:where(.setto-form__input,.setto-form__textarea,.setto-form__select)::placeholder{color:inherit;opacity:.5}\n:where(.setto-form__input,.setto-form__textarea,.setto-form__select):focus-visible{outline:2px solid currentColor;outline-offset:1px}\n:where(.setto-form__button){border-color:currentColor;background:transparent;color:inherit}\n:where(.setto-form__button:disabled){opacity:.6;cursor:progress}\n:where(.setto-form__field-error,.setto-form__error){font-size:.875rem;color:#b42318;margin:0}\n:where(.setto-form__success-icon){color:#0f7b4f}\n:where(.setto-form__again){background:none;border:0;padding:0;color:inherit;text-decoration:underline;cursor:pointer;font:inherit;opacity:.8;width:fit-content;max-width:100%;text-align:inherit}\n:where(.setto-form [aria-invalid=\"true\"]){border-color:#b42318}\n";
@@ -24298,28 +24298,31 @@ function CheckIcon() {
24298
24298
  }
24299
24299
  const STYLE_ID$1 = "setto-form-styles";
24300
24300
  const BASE_CSS = `
24301
- :where(.setto-form){display:grid;gap:1.1rem;position:relative}
24302
- :where(.setto-form__field){display:grid;gap:.4rem;position:relative}
24303
- :where(.setto-form__label,.setto-form__legend){font-weight:500;line-height:1.3;padding:0}
24304
- :where(.setto-form__required){opacity:.6;margin-left:.15em}
24305
- :where(.setto-form__input,.setto-form__textarea,.setto-form__select){width:100%;box-sizing:border-box;padding:.7rem .85rem;border:1px solid color-mix(in srgb,currentColor 28%,transparent);border-radius:.6rem;background:color-mix(in srgb,currentColor 4%,transparent);color:inherit;font:inherit;line-height:1.4}
24301
+ .setto-form{display:grid;gap:1.1rem;position:relative}
24302
+ .setto-form :where(.setto-form__field){display:grid;gap:.4rem;position:relative}
24303
+ .setto-form :where(.setto-form__label,.setto-form__legend){font-weight:500;line-height:1.3;padding:0}
24304
+ .setto-form :where(.setto-form__required){opacity:.6;margin-left:.15em}
24305
+ .setto-form :where(.setto-form__input,.setto-form__textarea,.setto-form__select){width:100%;box-sizing:border-box;padding:.7rem .85rem;border-width:1px;border-style:solid;border-radius:.6rem;font:inherit;line-height:1.4}
24306
+ .setto-form :where(.setto-form__textarea){min-height:7.5rem;resize:vertical}
24307
+ .setto-form :where(.setto-form__fieldset){border:0;padding:0;margin:0;min-width:0;display:grid;gap:.5rem}
24308
+ .setto-form :where(.setto-form__options){display:grid;gap:.5rem}
24309
+ .setto-form :where(.setto-form__option,.setto-form__check){display:flex;gap:.6rem;align-items:flex-start;line-height:1.4;cursor:pointer;font-weight:400}
24310
+ .setto-form :where(.setto-form__option input,.setto-form__check input){margin:.25em 0 0;flex:none;accent-color:currentColor}
24311
+ .setto-form :where(.setto-form__actions){display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:center}
24312
+ .setto-form :where(.setto-form__button){cursor:pointer;font:inherit;font-weight:500;padding:.75rem 1.4rem;border-radius:999px;border-width:1px;border-style:solid}
24313
+ .setto-form :where(.setto-form__success){display:grid;gap:.75rem;justify-items:start;outline:none}
24314
+ .setto-form :where(.setto-form__success-icon){width:2.5rem;height:2.5rem}
24315
+ .setto-form :where(.setto-form__success-text){margin:0;font-size:1.05em}
24316
+ .setto-form :where(.setto-form__hp){position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
24317
+ :where(.setto-form__input,.setto-form__textarea,.setto-form__select){border-color:color-mix(in srgb,currentColor 28%,transparent);background:color-mix(in srgb,currentColor 4%,transparent);color:inherit}
24306
24318
  :where(.setto-form__input,.setto-form__textarea,.setto-form__select)::placeholder{color:inherit;opacity:.5}
24307
24319
  :where(.setto-form__input,.setto-form__textarea,.setto-form__select):focus-visible{outline:2px solid currentColor;outline-offset:1px}
24308
- :where(.setto-form__textarea){min-height:7.5rem;resize:vertical}
24309
- :where(.setto-form__fieldset){border:0;padding:0;margin:0;min-width:0;display:grid;gap:.5rem}
24310
- :where(.setto-form__options){display:grid;gap:.5rem}
24311
- :where(.setto-form__option,.setto-form__check){display:flex;gap:.6rem;align-items:flex-start;line-height:1.4;cursor:pointer;font-weight:400}
24312
- :where(.setto-form__option input,.setto-form__check input){margin:.25em 0 0;flex:none;accent-color:currentColor}
24313
- :where(.setto-form__field-error,.setto-form__error){font-size:.875rem;color:#b42318;margin:0}
24314
- :where(.setto-form [aria-invalid="true"]){border-color:#b42318}
24315
- :where(.setto-form__actions){display:flex;flex-wrap:wrap;gap:.75rem 1rem;align-items:center}
24316
- :where(.setto-form__button){cursor:pointer;font:inherit;font-weight:500;padding:.75rem 1.4rem;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit}
24320
+ :where(.setto-form__button){border-color:currentColor;background:transparent;color:inherit}
24317
24321
  :where(.setto-form__button:disabled){opacity:.6;cursor:progress}
24318
- :where(.setto-form__success){display:grid;gap:.75rem;justify-items:start;outline:none}
24319
- :where(.setto-form__success-icon){width:2.5rem;height:2.5rem;color:#0f7b4f}
24320
- :where(.setto-form__success-text){margin:0;font-size:1.05em}
24322
+ :where(.setto-form__field-error,.setto-form__error){font-size:.875rem;color:#b42318;margin:0}
24323
+ :where(.setto-form__success-icon){color:#0f7b4f}
24321
24324
  :where(.setto-form__again){background:none;border:0;padding:0;color:inherit;text-decoration:underline;cursor:pointer;font:inherit;opacity:.8;width:fit-content;max-width:100%;text-align:inherit}
24322
- :where(.setto-form__hp){position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
24325
+ :where(.setto-form [aria-invalid="true"]){border-color:#b42318}
24323
24326
  `;
24324
24327
  function useFormStyles() {
24325
24328
  useInsertionEffect(() => {