kempo-ui 0.4.10 → 0.4.12

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 (105) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/Chat.js +3 -3
  3. package/dist/components/SegmentedControl.js +16 -0
  4. package/docs/components/SegmentedControl.html +649 -0
  5. package/docs/components/accordion.html +3 -0
  6. package/docs/components/aside.html +3 -0
  7. package/docs/components/calendar.html +3 -0
  8. package/docs/components/card.html +3 -0
  9. package/docs/components/chat.html +3 -0
  10. package/docs/components/code-editor.html +3 -0
  11. package/docs/components/color-picker.html +3 -0
  12. package/docs/components/combobox.html +3 -0
  13. package/docs/components/content-slider.html +3 -0
  14. package/docs/components/context.html +3 -0
  15. package/docs/components/dialog.html +3 -0
  16. package/docs/components/dropdown.html +3 -0
  17. package/docs/components/filter-list.html +3 -0
  18. package/docs/components/focus-capture.html +3 -0
  19. package/docs/components/html-editor.html +3 -0
  20. package/docs/components/hybrid-component.html +3 -0
  21. package/docs/components/icon.html +3 -0
  22. package/docs/components/import.html +3 -0
  23. package/docs/components/light-component.html +3 -0
  24. package/docs/components/markdown-editor.html +3 -0
  25. package/docs/components/markdown.html +3 -0
  26. package/docs/components/nav-spacer.html +3 -0
  27. package/docs/components/nav.html +3 -0
  28. package/docs/components/photo-viewer.html +3 -0
  29. package/docs/components/progress.html +3 -0
  30. package/docs/components/resize.html +3 -0
  31. package/docs/components/segmented-control.html +728 -0
  32. package/docs/components/shadow-component.html +3 -0
  33. package/docs/components/show-more.html +3 -0
  34. package/docs/components/slider.html +3 -0
  35. package/docs/components/sortable.html +3 -0
  36. package/docs/components/speech-to-text.html +3 -0
  37. package/docs/components/spinner.html +3 -0
  38. package/docs/components/split.html +3 -0
  39. package/docs/components/table.html +3 -0
  40. package/docs/components/tableControls.html +3 -0
  41. package/docs/components/tableCustomFields.html +3 -0
  42. package/docs/components/tableFetchRecords.html +3 -0
  43. package/docs/components/tableFieldSortHide.html +3 -0
  44. package/docs/components/tablePagination.html +3 -0
  45. package/docs/components/tablePlaceholder.html +3 -0
  46. package/docs/components/tableRecordEditing.html +3 -0
  47. package/docs/components/tableRecordFiltering.html +3 -0
  48. package/docs/components/tableRecordHiding.html +3 -0
  49. package/docs/components/tableRecordSearching.html +3 -0
  50. package/docs/components/tableRecordSelection.html +3 -0
  51. package/docs/components/tableRowControls.html +3 -0
  52. package/docs/components/tableServerSync.html +3 -0
  53. package/docs/components/tableSorting.html +3 -0
  54. package/docs/components/tabs.html +3 -0
  55. package/docs/components/tags.html +3 -0
  56. package/docs/components/text-to-speech.html +3 -0
  57. package/docs/components/theme-select.html +3 -0
  58. package/docs/components/theme-switcher.html +3 -0
  59. package/docs/components/time.html +3 -0
  60. package/docs/components/timestamp.html +3 -0
  61. package/docs/components/toast.html +3 -0
  62. package/docs/components/toggle.html +3 -0
  63. package/docs/components/tree.html +3 -0
  64. package/docs/components/voice-selector.html +3 -0
  65. package/docs/icons/account-circle.svg +1 -1
  66. package/docs/index.html +9 -0
  67. package/docs/src/components/Chat.js +3 -3
  68. package/docs/src/components/SegmentedControl.js +16 -0
  69. package/docs/utils/context.html +3 -0
  70. package/docs/utils/cookie.html +3 -0
  71. package/docs/utils/debounce.html +3 -0
  72. package/docs/utils/drag.html +3 -0
  73. package/docs/utils/elevation.html +3 -0
  74. package/docs/utils/formatTimestamp.html +3 -0
  75. package/docs/utils/object.html +3 -0
  76. package/docs/utils/propConverters.html +3 -0
  77. package/docs/utils/sanitizeHtml.html +3 -0
  78. package/docs/utils/string.html +3 -0
  79. package/docs/utils/theme.html +3 -0
  80. package/docs/utils/toTitleCase.html +3 -0
  81. package/docs/utils/type.html +3 -0
  82. package/docs/utils/voice.html +3 -0
  83. package/docs/utils/wait.html +3 -0
  84. package/docs-src/components/segmented-control.page.html +236 -0
  85. package/docs-src/index.page.html +6 -0
  86. package/docs-src/nav.fragment.html +3 -0
  87. package/icons/account-circle.svg +1 -1
  88. package/llms.txt +1 -0
  89. package/package.json +1 -1
  90. package/src/components/Chat.js +3 -3
  91. package/src/components/SegmentedControl.js +118 -0
  92. package/tasks/released/0003-chat-send-button-size/after-fix-screenshot.png +0 -0
  93. package/tasks/released/0003-chat-send-button-size/current-state-issue.png +0 -0
  94. package/tasks/released/0003-chat-send-button-size.md +84 -0
  95. package/tasks/released/0004-create-segmented-control-component/component-rendering.png +0 -0
  96. package/tasks/released/0004-create-segmented-control-component/final-component-page.png +0 -0
  97. package/tasks/released/0004-create-segmented-control-component/form-integration-section.png +0 -0
  98. package/tasks/released/0004-create-segmented-control-component/option-element-section.png +0 -0
  99. package/tasks/released/0004-create-segmented-control-component/page-screenshot.png +0 -0
  100. package/tasks/released/0004-create-segmented-control-component/validation-form-integration.png +0 -0
  101. package/tasks/released/0004-create-segmented-control-component/validation-screenshot-1-full-page.png +0 -0
  102. package/tasks/released/0004-create-segmented-control-component/validation-screenshot-2-icon-options.png +0 -0
  103. package/tasks/released/0004-create-segmented-control-component.md +106 -0
  104. package/tests/components/Chat.browser-test.js +829 -0
  105. package/tests/components/SegmentedControl.browser-test.js +223 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.4.12] - 2026-05-03
10
+ ### Added
11
+ - **SegmentedControl component**: New form-integrated segmented control component
12
+ - Renders child `<k-sc-option>` elements as a button group using Kempo-CSS utility classes
13
+ - Supports rich content in options including text and icon elements (via `<k-icon>`)
14
+ - Full form integration using ElementInternals API (`formAssociated`) for proper form submission and reset
15
+ - `name` attribute for form field identification
16
+ - `value` property reflects and controls the selected option
17
+ - Dispatches `change` events when selection changes
18
+ - Comprehensive unit test suite with 13 test cases covering element creation, properties, option recognition, selection, styling, and events
19
+ - Complete documentation with examples: Basic Usage, Selected By Default, JavaScript Usage, Icon Options, and Form Integration
20
+ - Test file: `tests/components/SegmentedControl.browser-test.js`
21
+ - Documentation: `docs-src/components/segmented-control.page.html`
22
+
23
+ ## [0.4.11] - 2026-05-01
24
+ ### Added
25
+ - **Chat component**: Comprehensive unit test suite with 62 test cases
26
+ - Tests cover component initialization, properties, and attributes
27
+ - Tests for message management (add, update, remove, clear operations)
28
+ - Tests for send button styling and functionality
29
+ - Tests for message rendering, status displays, and sender names
30
+ - Tests for HTML sanitization and security
31
+ - Test file: `tests/components/Chat.browser-test.js`
32
+
33
+ ### Fixed
34
+ - **Chat component**: Send button now displays at its natural size instead of being artificially constrained
35
+ - Changed from fixed `width` and `height` to `min-width` and `min-height` properties
36
+ - Added proper padding using theme-configurable `--spacer_q` custom property for consistent spacing
37
+ - Button maintains circular appearance and primary color styling
38
+
9
39
  ## [0.4.10] - 2026-05-01
10
40
  ### Added
11
41
  - **MarkdownEditor component**: Comprehensive unit test suite with 40+ test cases
@@ -177,9 +177,9 @@ import{html as e,css as t,nothing as s}from"../lit-all.min.js";import i from"./S
177
177
  display: inline-flex;
178
178
  align-items: center;
179
179
  justify-content: center;
180
- width: 2rem;
181
- height: 2rem;
182
- padding: 0;
180
+ min-width: 2rem;
181
+ min-height: 2rem;
182
+ padding: var(--spacer_q);
183
183
  border: 1px solid transparent;
184
184
  border-radius: 50%;
185
185
  background: var(--c_primary);
@@ -0,0 +1,16 @@
1
+ import{html as t,css as e,unsafeHTML as s}from"../lit-all.min.js";import n from"./ShadowComponent.js";class i extends n{static formAssociated=!0;static properties={value:{type:String,reflect:!0},name:{type:String}};constructor(){if(super(),this.value="",this.name="",this.initialValue="","function"==typeof this.attachInternals)try{this.internals=this.attachInternals()}catch(t){}}connectedCallback(){super.connectedCallback(),this.initialValue=this.getAttribute("value")||"",this.addEventListener("slotchange",this.handleSlotChange,!0);const t=this.closest("form");t&&t.addEventListener("reset",this.handleReset,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slotchange",this.handleSlotChange,!0);const t=this.closest("form");t&&t.removeEventListener("reset",this.handleReset,!0)}updated(t){if(super.updated(t),t.has("value")){if(this.internals&&"function"==typeof this.internals.setFormValue)try{this.internals.setFormValue(this.value||null)}catch(t){}this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}}handleSlotChange=()=>{this.requestUpdate()};handleReset=()=>{this.value=this.initialValue};handleButtonClick=t=>{this.value=t};getOptions=()=>Array.from(this.children).filter(t=>"K-SC-OPTION"===t.tagName);render(){const e=this.getOptions();return t`
2
+ <div class="btn-grp">
3
+ ${e.map(e=>{const n=e.getAttribute("value")||"",i=n===this.value;return t`
4
+ <button
5
+ class="${i?"primary":""}"
6
+ @click=${()=>this.handleButtonClick(n)}
7
+ ?aria-pressed=${i}
8
+ >${s(e.innerHTML)}</button>
9
+ `})}
10
+ </div>
11
+ <slot style="display:none;"></slot>
12
+ `}static styles=e`
13
+ :host {
14
+ display: block;
15
+ }
16
+ `}class a extends HTMLElement{connectedCallback(){this.hasAttribute("value")||this.setAttribute("value","")}}export default i;customElements.define("k-segmented-control",i),customElements.define("k-sc-option",a);