@wrdagency/blockout 0.1.3 → 0.1.4

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.
@@ -1 +1 @@
1
- .component-select-control__input{cursor:pointer;display:flex;width:100%}.component-select-control__input:focus{outline:none}.component-select-control__value{flex-grow:1;padding:.75rem;min-height:40px;width:100%;min-width:0;max-width:100%;color:var(--blockout__colours__surface--800);border-top-left-radius:var(--blockout__radius--md);border-bottom-left-radius:var(--blockout__radius--md);font-size:1rem;text-align:left;background-color:transparent;transition:background-color .25s ease}.component-select-control__value--placeholder{color:var(--blockout__colours__surface--400)}.component-select-control__input:disabled .component-select-control__value{background-color:var(--blockout__colours__surface--300);color:var(--blockout__colours__surface--500)}.component-select-control__input:disabled .component-select-control__caret{background-color:var(--blockout__colours__surface--300)}.component-select-control__input:disabled .component-select-control__caret>svg{fill:var(--blockout__colours__surface--500)}.component-select-control .component-base-control__box:focus-within{background-color:var(--blockout__colours__surface--50);border-color:var(--blockout__colours__surface--300);outline:1px solid var(--blockout__colours__outline);outline-offset:4px}.component-select-control__value:hover{background-color:var(--blockout__colours__surface--200)}.component-select-control__caret{flex-shrink:0;width:2rem;display:flex;justify-content:center;align-items:center;border-top-right-radius:var(--blockout__radius--md);border-bottom-right-radius:var(--blockout__radius--md);background-color:var(--blockout__colours__surface--100);cursor:pointer;transition:background-color .25s ease}.component-select-control__caret:hover{background-color:var(--blockout__colours__surface--200)}.component-select-control__caret>svg{width:.75rem;height:.75rem;fill:var(--blockout__colours__surface--700)}.component-select-control__popover__wrapper{z-index:9999!important}.component-select-control__popover{background-color:var(--blockout__colours__surface--200);border:1px solid var(--blockout__colours__surface--300);border-radius:var(--blockout__radius--lg);width:calc(var(--popover-anchor-width) + 2px);max-height:var(--popover-available-height);overflow-y:auto}.component-select-control__popover:focus{outline:none}.component-select-control__list{display:flex;flex-direction:column;gap:.325rem;padding:.325rem}.component-select-control__list:focus{outline:none}.component-select-control__popover__search-wrapper{display:flex;align-items:center;gap:0;padding-left:1rem}.component-select-control__popover__search-icon{width:1rem;height:1rem;transform:translateY(.25rem);fill:var(--blockout__colours__surface--500)}.component-select-control__popover__search{width:100%;padding:.5rem .675rem 0rem;min-height:40px}.component-select-control__popover__search:focus{outline:none}.component-select-control__option{display:flex;justify-content:center;align-items:start;flex-direction:column;gap:.25rem;padding:.375rem .675rem;border-radius:var(--blockout__radius--sm);min-height:40px;cursor:pointer;transition:background-color .25s ease}.component-select-control__option:focus{outline:none}.component-select-control__option:first-child{border-top:none}.component-select-control__option[aria-disabled=true] .component-select-control__option__label{color:var(--blockout__colours__surface--400)}.component-select-control__option[aria-disabled=true] .component-select-control__option__description{color:var(--blockout__colours__surface--300)}.component-select-control__option__label{display:flex;align-items:center;gap:.5rem;font-weight:500;color:var(--blockout__colours__surface--900);transition:color .25s ease}.component-select-control__option__label>svg{width:1.25rem;height:1.25rem}.component-select-control__option__description{font-weight:400;color:var(--blockout__colours__surface--600);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-select-control__option[data-active-item=true]{background-color:var(--blockout__colours__surface--50)}.component-select-control__option[data-active-item=true] .component-select-control__option__label{color:var(--blockout__colours__surface--900)}.component-select-control__option[data-active-item=true] .component-select-control__option__description{color:var(--blockout__colours__surface--700)}
1
+ .component-select-control .component-base-control__control{flex-grow:1!important}.component-select-control__input{cursor:pointer;display:flex;width:100%}.component-select-control__input:focus{outline:none}.component-select-control__value{display:flex;flex-direction:row;flex-grow:1;padding:.75rem;min-height:40px;width:100%;min-width:0;max-width:100%;color:var(--blockout__colours__surface--800);border-top-left-radius:var(--blockout__radius--md);border-bottom-left-radius:var(--blockout__radius--md);font-size:1rem;text-align:left;background-color:transparent;transition:background-color .25s ease}.component-select-control__value .component-base-control__affix{padding:0;min-height:0}.component-select-control__value .component-base-control__affix--prefix{padding-right:.75rem}.component-select-control__value .component-base-control__affix--suffix{padding-left:.75rem}.component-select-control__value--placeholder{color:var(--blockout__colours__surface--400)}.component-select-control__input:disabled .component-select-control__value{background-color:var(--blockout__colours__surface--300);color:var(--blockout__colours__surface--500)}.component-select-control__input:disabled .component-select-control__caret{background-color:var(--blockout__colours__surface--300)}.component-select-control__input:disabled .component-select-control__caret>svg{fill:var(--blockout__colours__surface--500)}.component-select-control .component-base-control__box:focus-within{background-color:var(--blockout__colours__surface--50);border-color:var(--blockout__colours__surface--300);outline:1px solid var(--blockout__colours__outline);outline-offset:4px}.component-select-control__value:hover{background-color:var(--blockout__colours__surface--200)}.component-select-control__caret{flex-shrink:0;width:2rem;display:flex;justify-content:center;align-items:center;border-top-right-radius:var(--blockout__radius--md);border-bottom-right-radius:var(--blockout__radius--md);background-color:var(--blockout__colours__surface--100);cursor:pointer;transition:background-color .25s ease}.component-select-control__caret:hover{background-color:var(--blockout__colours__surface--200)}.component-select-control__caret>svg{width:.75rem;height:.75rem;fill:var(--blockout__colours__surface--700)}.component-select-control__popover__wrapper{z-index:9999!important}.component-select-control__popover{background-color:var(--blockout__colours__surface--200);border:1px solid var(--blockout__colours__surface--300);border-radius:var(--blockout__radius--lg);width:calc(var(--popover-anchor-width) + 2px);max-height:var(--popover-available-height);overflow-y:auto}.component-select-control__popover:focus{outline:none}.component-select-control__list{display:flex;flex-direction:column;gap:.325rem;padding:.325rem}.component-select-control__list:focus{outline:none}.component-select-control__popover__search-wrapper{display:flex;align-items:center;gap:0;padding-left:1rem}.component-select-control__popover__search-icon{width:1rem;height:1rem;transform:translateY(.25rem);fill:var(--blockout__colours__surface--500)}.component-select-control__popover__search{width:100%;padding:.5rem .675rem 0rem;min-height:40px}.component-select-control__popover__search:focus{outline:none}.component-select-control__option{display:flex;justify-content:center;align-items:start;flex-direction:column;gap:.25rem;padding:.375rem .675rem;border-radius:var(--blockout__radius--sm);min-height:40px;cursor:pointer;transition:background-color .25s ease}.component-select-control__option:focus{outline:none}.component-select-control__option:first-child{border-top:none}.component-select-control__option[aria-disabled=true] .component-select-control__option__label{color:var(--blockout__colours__surface--400)}.component-select-control__option[aria-disabled=true] .component-select-control__option__description{color:var(--blockout__colours__surface--300)}.component-select-control__option__label{display:flex;align-items:center;gap:.5rem;font-weight:500;color:var(--blockout__colours__surface--900);transition:color .25s ease}.component-select-control__option__label>svg{width:1.25rem;height:1.25rem}.component-select-control__option__description{font-weight:400;color:var(--blockout__colours__surface--600);font-size:.875rem;transition:color .25s ease,opacity .25s ease}.component-select-control__option[data-active-item=true]{background-color:var(--blockout__colours__surface--50)}.component-select-control__option[data-active-item=true] .component-select-control__option__label{color:var(--blockout__colours__surface--900)}.component-select-control__option[data-active-item=true] .component-select-control__option__description{color:var(--blockout__colours__surface--700)}
@@ -1,8 +1,15 @@
1
1
  import { FC } from 'react';
2
- export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
3
- className?: string;
2
+ type BaseProps = {
4
3
  variant?: "primary" | "quiet" | "ghost" | "neutral";
5
4
  size?: "small" | "medium" | "large";
6
5
  wide?: boolean;
7
- }
6
+ };
7
+ type ButtonButtonProps = BaseProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof BaseProps> & {
8
+ as?: "button";
9
+ };
10
+ type LinkButtonProps = BaseProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof BaseProps> & {
11
+ as: "link";
12
+ };
13
+ export type ButtonProps = ButtonButtonProps | LinkButtonProps;
8
14
  export declare const Button: FC<ButtonProps>;
15
+ export {};
@@ -1,28 +1,15 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { cn as c } from "../../utils/css.js";
3
- import '../../assets/button.css';const s = ({
4
- children: t,
5
- className: o,
6
- variant: n = "primary",
7
- size: m = "medium",
8
- wide: e = !1,
9
- type: r = "button",
10
- ...u
11
- }) => /* @__PURE__ */ p(
12
- "button",
13
- {
14
- type: r,
15
- className: c(
16
- o,
17
- "component-button",
18
- `component-button--${n}`,
19
- `component-button--${m}`,
20
- e && "component-button--wide"
21
- ),
22
- ...u,
23
- children: t
24
- }
25
- );
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { cn as o } from "../../utils/css.js";
3
+ import '../../assets/button.css';const c = (t) => {
4
+ const n = o(
5
+ t.className,
6
+ "component-button",
7
+ `component-button--${t.variant || "primary"}`,
8
+ `component-button--${t.size || "medium"}`,
9
+ t.wide && "component-button--wide"
10
+ );
11
+ return t.as === "link" ? /* @__PURE__ */ e("a", { ...t, className: n }) : /* @__PURE__ */ e("button", { type: "button", ...t, className: n });
12
+ };
26
13
  export {
27
- s as Button
14
+ c as Button
28
15
  };
@@ -1,5 +1,4 @@
1
1
  import { FC } from 'react';
2
2
  import { ButtonProps } from './button';
3
- export interface IconButtonProps extends Omit<ButtonProps, "wide" | "variant"> {
4
- }
3
+ export type IconButtonProps = Omit<ButtonProps, "wide">;
5
4
  export declare const IconButton: FC<IconButtonProps>;
@@ -1,17 +1,13 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { cn as r } from "../../utils/css.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { cn as n } from "../../utils/css.js";
3
3
  import { Button as m } from "./button.js";
4
- const p = ({
5
- className: o,
6
- ...t
7
- }) => /* @__PURE__ */ n(
4
+ const s = (o) => /* @__PURE__ */ t(
8
5
  m,
9
6
  {
10
- className: r("component-button--icon", o),
11
- variant: "quiet",
12
- ...t
7
+ ...o,
8
+ className: n("component-button--icon", o.className)
13
9
  }
14
10
  );
15
11
  export {
16
- p as IconButton
12
+ s as IconButton
17
13
  };