@kolkrabbi/kol-component 0.12.18 → 0.13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.12.18",
3
+ "version": "0.13.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
  "@floating-ui/react": "^0.27.19",
25
25
  "embla-carousel-react": "^8.6.0",
26
26
  "react-syntax-highlighter": "^16.1.1",
27
- "@kolkrabbi/kol-icons": "0.8.4"
27
+ "@kolkrabbi/kol-icons": "0.8.10"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "framer-motion": "^12.0.0",
@@ -1,16 +1,25 @@
1
1
  /**
2
- * Pill Component
2
+ * Pill — the STATIC chip: a label, category, or status word. Not clickable.
3
3
  *
4
- * Small badge/tag component for labels, categories, or status indicators
5
- * Uses existing pill classes from components.css (pill-outline, pill-subtle, pill-inverse)
4
+ * The chip family, so the right one gets reached for (documented at source,
5
+ * 2026-07-30):
6
+ * Pill — static label. No states, no handlers. THIS component.
7
+ * Tag — interactive/filterable. Its active/onClick/onRemove states are the
8
+ * whole point; a Tag with no handler is a Pill wearing the wrong name.
9
+ * Badge — system status or a count.
10
+ *
11
+ * Defaults follow the standing laws: `subtle` (nothing defaults to outline —
12
+ * outline needs a stated reason) and `sm` (chip law). Both were wrong until
13
+ * 2026-07-30 — the component defaulted outline/md, so every correct call site
14
+ * had to pass both props explicitly.
6
15
  *
7
16
  * @param {Object} props
8
17
  * @param {string} props.children - Text content of the pill
9
- * @param {string} props.variant - Visual variant: 'outline' | 'subtle' | 'inverse' (default: 'outline')
10
- * @param {string} props.size - Size variant: 'sm' | 'md' | 'lg' (default: 'md')
18
+ * @param {string} props.variant - Visual variant: 'subtle' | 'outline' | 'inverse' (default: 'subtle')
19
+ * @param {string} props.size - Size variant: 'sm' | 'md' | 'lg' (default: 'sm')
11
20
  * @param {string} props.className - Additional classes for customization
12
21
  */
13
- const Pill = ({ children, variant = 'outline', size = 'md', className = '' }) => {
22
+ const Pill = ({ children, variant = 'subtle', size = 'sm', className = '' }) => {
14
23
  const variantClasses = {
15
24
  outline: 'pill-outline',
16
25
  subtle: 'pill-subtle',
package/src/atoms/Tag.jsx CHANGED
@@ -3,19 +3,29 @@ import { Icon } from '@kolkrabbi/kol-icons'
3
3
  const ICON_SIZES = { sm: 10, md: 12, lg: 14 }
4
4
 
5
5
  /**
6
- * Tag — canonical (merged web rich + brand compat).
6
+ * Tag — the INTERACTIVE chip: filterable, selectable, removable.
7
7
  *
8
- * Web's rich API: variant (default/naked/inverse/solid), size, color, solid,
9
- * active, icon, onRemove, onClick. Plus:
8
+ * The chip family (documented at source, 2026-07-30):
9
+ * Pill — static label. No states, no handlers. Reach for this for decoration.
10
+ * Tag — interactive/filterable. THIS component. Its `active`/`onClick`/
11
+ * `onRemove` states are the point — a Tag with no handler renders a
12
+ * <span> and is a Pill wearing the wrong name.
13
+ * Badge — system status or a count.
14
+ *
15
+ * Canonical (merged web rich + brand compat). Web's rich API: variant
16
+ * (default/naked/inverse/solid), size, color, solid, active, icon, onRemove,
17
+ * onClick. Plus:
10
18
  * - `hash` (default true) — prepend `#` (web's tag style). Pass hash={false}
11
19
  * for plain labels (brand usage).
12
20
  * - `text` — content fallback when no children (brand SwatchControls passes text=).
21
+ *
22
+ * `size` defaults to `sm` per the chip law (2026-07-30, same pass as Pill).
13
23
  */
14
24
  export default function Tag({
15
25
  children,
16
26
  text,
17
27
  variant = 'default',
18
- size = 'md',
28
+ size = 'sm',
19
29
  color,
20
30
  solid = false,
21
31
  active = false,
@@ -146,14 +146,15 @@ const ContentFilters = ({
146
146
  </h2>
147
147
  <Divider variant="vertical" className="self-stretch py-1" />
148
148
  <div className="flex items-center gap-1">
149
- <Button
150
- iconOnly="filter"
151
- iconSize={20}
152
- size="md"
153
- variant="ghost"
149
+ <button
150
+ type="button"
154
151
  onClick={() => setIsExpanded(!isExpanded)}
152
+ className="kol-btn kol-btn-md kol-btn-icon"
155
153
  aria-label="Toggle filters"
156
- />
154
+ style={{ background: 'transparent', border: 'none', cursor: 'pointer', color: 'inherit' }}
155
+ >
156
+ <Icon name="filter" size={20} />
157
+ </button>
157
158
  <div
158
159
  className="flex items-center justify-center rounded-sm cursor-pointer hover:bg-fg-04 transition-colors"
159
160
  style={{
@@ -170,7 +171,7 @@ const ContentFilters = ({
170
171
  }}
171
172
  >
172
173
  <span
173
- className="kol-btn kol-btn-ghost kol-btn-md kol-btn-icon flex items-center justify-center flex-shrink-0"
174
+ className="kol-btn kol-btn-md kol-btn-icon flex items-center justify-center flex-shrink-0"
174
175
  style={{
175
176
  opacity: searchOpen ? 0 : 1,
176
177
  transition: 'opacity 300ms cubic-bezier(0.16, 1, 0.3, 1)',