@kolkrabbi/kol-component 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,7 +15,7 @@ Requires a **Vite + Tailwind v4** app and the theme CSS imported (see the theme
15
15
 
16
16
  ```jsx
17
17
  import { Button, Tag, Badge, Slider, Dropdown, Table } from '@kolkrabbi/kol-component'
18
- import { Icon } from '@kolkrabbi/kol-loader'
18
+ import { Icon } from '@kolkrabbi/kol-icons'
19
19
 
20
20
  <Button variant="primary" iconLeft="plus">New</Button>
21
21
  <Badge variant="success">Active</Badge>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@floating-ui/react": "^0.27.19",
26
26
  "embla-carousel-react": "^8.6.0",
27
- "@kolkrabbi/kol-loader": "0.3.0"
27
+ "@kolkrabbi/kol-icons": "0.4.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "react": "^18.3.0 || ^19.0.0",
@@ -5,7 +5,7 @@
5
5
  * CSS classes live in components.css under 2-LABELS → Badges.
6
6
  */
7
7
 
8
- import { Icon } from '@kolkrabbi/kol-loader'
8
+ import { Icon } from '@kolkrabbi/kol-icons'
9
9
 
10
10
  const VARIANT_MAP = {
11
11
  default: 'kol-badge-default',
@@ -1,5 +1,5 @@
1
1
  import { isValidElement } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
 
4
4
  /**
5
5
  * Button — canonical KOL button. Emits kol-btn* classes (CSS in @kol/theme).
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  /**
4
4
  * Input — single-input atom built on the .kol-control shell.
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  /**
4
4
  * SearchInput — controlled search field on the .kol-control shell. The
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  export default function SectionLabel({
4
4
  text,
@@ -26,15 +26,16 @@
26
26
  * value — current option value
27
27
  * onChange — handler (newValue) => void
28
28
  * options — [{ value, label, ariaLabel? }]
29
- * size — 'md' (default, 26px) | 'sm' (16px). `sm` is for icon/preview-
30
- * only options (e.g. line-style previews) where text labels
31
- * aren't used; the cells still center their contents but the
32
- * outer height is tighter.
29
+ * size — mirrors Button exactly: 'sm' (26px, mono-12, 4/12 pad) |
30
+ * 'md' (default, 32px, mono-14, 6/16 pad) | 'lg' (40px,
31
+ * mono-16, 8/20 pad). Same cell padding + mono type as the
32
+ * matching `.kol-btn-{sm,md,lg}`, so a segmented strip lines
33
+ * up with a Button of the same size.
33
34
  * ariaLabel — accessible name for the group
34
35
  * className — additional classes on the outer shell
35
36
  */
36
37
  export default function SegmentedToggle({ value, onChange, options = [], size = 'md', ariaLabel, className = '' }) {
37
- const cellType = size === 'sm' ? '' : 'kol-mono-12'
38
+ const cellType = { sm: 'kol-mono-12', md: 'kol-mono-14', lg: 'kol-mono-16' }[size]
38
39
  const focusIdx = Math.max(0, options.findIndex((opt) => opt.value === value))
39
40
 
40
41
  const handleKeyDown = (e) => {
@@ -51,7 +52,7 @@ export default function SegmentedToggle({ value, onChange, options = [], size =
51
52
  role="radiogroup"
52
53
  aria-label={ariaLabel}
53
54
  onKeyDown={handleKeyDown}
54
- className={['kol-seg', size === 'sm' && 'kol-seg--sm', className].filter(Boolean).join(' ')}
55
+ className={['kol-seg', size !== 'md' && `kol-seg--${size}`, className].filter(Boolean).join(' ')}
55
56
  >
56
57
  {options.map((opt, i) => {
57
58
  const isActive = opt.value === value
@@ -8,7 +8,7 @@
8
8
  * stroke icons in the kol curated set. For a plain number input without
9
9
  * bump affordance, use `<Input type="number" />`.
10
10
  */
11
- import { Icon } from '@kolkrabbi/kol-loader'
11
+ import { Icon } from '@kolkrabbi/kol-icons'
12
12
 
13
13
  const SIZE_TYPE = { sm: 'kol-mono-12', md: 'kol-mono-14', lg: 'kol-mono-16' }
14
14
  const CHEVRON_SIZE = { sm: 8, md: 10, lg: 12 }
package/src/atoms/Tag.jsx CHANGED
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  const ICON_SIZES = { sm: 10, md: 12, lg: 14 }
4
4
 
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  /**
4
4
  * Textarea — multi-line text atom built on the .kol-control shell with the
@@ -1,4 +1,4 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
3
  /**
4
4
  * ViewToggle — control for switching between view modes.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * The raw SVG strings (~4.8 MB) live in ./graphicData.js behind a single
8
8
  * dynamic import — their chunk streams in parallel with boot instead of
9
- * bloating the consumer's entry chunk (same pattern as kol-loader's Icon).
9
+ * bloating the consumer's entry chunk (same pattern as kol-icons's Icon).
10
10
  * Until the chunk lands, renders a sized empty box (no layout shift); a
11
11
  * genuinely missing asset renders an AssetPlaceholder so it's visible rather
12
12
  * than silently empty.
@@ -4,7 +4,7 @@
4
4
  * ~4.8 MB of illustration SVGs (some wrap embedded raster images) eager-inline
5
5
  * here, but this module is only reached via the dynamic `import()` in
6
6
  * Graphic.jsx — the bundler splits it into its own async chunk instead of
7
- * folding it into the consumer's entry chunk. Same pattern as kol-loader's
7
+ * folding it into the consumer's entry chunk. Same pattern as kol-icons's
8
8
  * iconData.js (kol-labs-single 2026-06-19 entry-chunk fix).
9
9
  */
10
10
  const svgModules = import.meta.glob('./svg/**/*.svg', { eager: true, query: '?raw', import: 'default' })
package/src/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Placement follows the taxonomy rules in
9
9
  * docs/documentation/02-components/02-placement.md:
10
- * atom — nests no KOL component (kol-loader Icon/Graphic are
10
+ * atom — nests no KOL component (kol-icons Icon/Graphic are
11
11
  * infrastructure, they don't count)
12
12
  * molecule — nests at least one KOL component
13
13
  * organism — a self-contained composed UI region
@@ -124,7 +124,7 @@ export { default as SpectrumGrid } from './organisms/SpectrumGrid.jsx'
124
124
  export { default as Table } from './organisms/Table.jsx'
125
125
 
126
126
  // loaders (re-export — infrastructure, documented on /docs/loaders)
127
- export { Icon } from '@kolkrabbi/kol-loader'
127
+ export { Icon } from '@kolkrabbi/kol-icons'
128
128
 
129
129
  // graphics (SVG illustration loader — globs its own ./graphics/svg/**)
130
130
  export { default as Graphic, GRAPHICS } from './graphics/Graphic.jsx'
@@ -1,6 +1,6 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
- /* taxonomy-ok: nests only kol-loader's Icon (a package import the
3
+ /* taxonomy-ok: nests only kol-icons's Icon (a package import the
4
4
  * relative-import check can't see). */
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import ColorSwatch from './ColorSwatch'
4
4
  import Input from '../atoms/Input'
5
5
  import LabeledControl from '../atoms/LabeledControl'
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import { MenuDropdownItem } from './MenuItem.jsx'
4
4
  import { PopoverPanel, usePopover } from '../atoms/Popover.jsx'
5
5
 
@@ -1,6 +1,6 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
 
3
- /* taxonomy-ok: nests kol-loader's Icon (a package import the relative-import
3
+ /* taxonomy-ok: nests kol-icons's Icon (a package import the relative-import
4
4
  * check can't see) plus the same-file SelectIndicator. */
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import { PopoverPanel, usePopover } from '../atoms/Popover.jsx'
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import Button from '../atoms/Button.jsx'
4
4
  import { PopoverPanel, usePopover } from '../atoms/Popover.jsx'
5
5
  import { MenuDropdownItem } from './MenuItem.jsx'
@@ -1,9 +1,9 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
2
  import { createPortal } from 'react-dom'
3
- import { Icon } from '@kolkrabbi/kol-loader'
3
+ import { Icon } from '@kolkrabbi/kol-icons'
4
4
  import usePrefersReducedMotion from '../hooks/usePrefersReducedMotion.js'
5
5
 
6
- /* taxonomy-ok: nests kol-loader's Icon (a package import the relative-import
6
+ /* taxonomy-ok: nests kol-icons's Icon (a package import the relative-import
7
7
  * check can't see). */
8
8
 
9
9
  const FOCUSABLE =
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import ColorSwatch from './ColorSwatch.jsx'
4
4
 
5
5
  /* taxonomy-ok: the default composed control nests the same-file SwatchStack
@@ -1,7 +1,7 @@
1
1
  import { useRef } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
 
4
- /* taxonomy-ok: nests kol-loader's Icon */
4
+ /* taxonomy-ok: nests kol-icons's Icon */
5
5
 
6
6
  /**
7
7
  * TabsRow — labeled underline tab strip: text tabs where the active tab gets
@@ -1,8 +1,8 @@
1
- import { Icon } from '@kolkrabbi/kol-loader'
1
+ import { Icon } from '@kolkrabbi/kol-icons'
2
2
  import Dropdown from '../Dropdown.jsx'
3
3
  import Divider from '../../atoms/Divider.jsx'
4
4
 
5
- /* taxonomy-ok: nests DS Dropdown + Divider (relative imports) plus kol-loader's
5
+ /* taxonomy-ok: nests DS Dropdown + Divider (relative imports) plus kol-icons's
6
6
  * Icon (a package import the relative-import check can't see). */
7
7
 
8
8
  /**
@@ -1,7 +1,7 @@
1
1
  import { useState, useMemo, useRef, useEffect } from 'react'
2
2
  import Tag from '../atoms/Tag.jsx'
3
3
  import Divider from '../atoms/Divider.jsx'
4
- import { Icon } from '@kolkrabbi/kol-loader'
4
+ import { Icon } from '@kolkrabbi/kol-icons'
5
5
  import ViewToggle from '../atoms/ViewToggle'
6
6
 
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  import FullscreenOverlay from '../atoms/FullscreenOverlay.jsx'
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
- import { Icon } from '@kolkrabbi/kol-loader'
2
+ import { Icon } from '@kolkrabbi/kol-icons'
3
3
 
4
4
  /* taxonomy-ok: composites a segmented toggle + an inline search into one
5
- * space-trading control (organism); nests kol-loader's Icon (infrastructure). */
5
+ * space-trading control (organism); nests kol-icons's Icon (infrastructure). */
6
6
 
7
7
  const CUBIC_EASE = 'cubic-bezier(0.16, 1, 0.3, 1)'
8
8
  /* The pill uses a springier overshoot ease, distinct from CUBIC_EASE. */